Questions tagged as 'ggplot2'

1
answer

How to insert data for graphing in ggplot

I want to make a line graph with ggplot, but this message appears:    Error: Do not know how to add geom_point to a plot Here's the template I'm doing: a<-c(4.9, 4.4, 4.2, 3.9, 3.7, 3.5, 3.1, 3, 2.9, 3, 2.8, 2.7, 2.6, 2.5) b<-c(...
asked by 26.10.2014 / 21:47
1
answer

How to loop to generate graphics in R?

Consider the following Data Frame: ITENS <-c("A","B","C","D","E") Q.1 <-c(10,20,10,40,10) Q.2 <-c(5,25,0,50,10) Q.3 <-c(15,20,5,40,10) Q.4 <-c(15,30,5,30,5) Q.5 <-c(20,25,5,20,15) Q.6 <-c(10,20,10,40,10) df <- data.fram...
asked by 10.05.2018 / 02:37
1
answer

Graph of the Conditional Densities of a Linear Regression

I have this date frame with two columns: Y and X. data=structure(list(Y = c(NA, -1.793, -0.642, 1.189, -0.823, -1.715, 1.623, 0.964, 0.395, -3.736, -0.47, 2.366, 0.634, -0.701, -1.692, 0.155, 2.502, -2.292, 1.967, -2.326, -1.476, 1.4...
asked by 15.11.2016 / 23:08
1
answer

How do I set the tab for spatial lines in ggplot?

I'm plotting lines on polygons, but when I try to insert the legend the lines look bad, how do I adjust that? Without the Legend library("ggplot2") ggplot(mapa_mg) + aes(x=long, y=lat, group=group) + geom_polygon(fill = "white") +...
asked by 08.07.2018 / 02:02
2
answers

How to sort the x-axis boundaries in ggplot?

I have the following data: k <- c(294131, 734127, 817963) ano <- c(1991, 2000, 2010) dados <- data.frame(k, ano) I'm doing it this way: ggplot(dados,aes(x=ano,y=k)) + geom_point() + geom_line() + scale_x_continuous(limits=c(1991,...
asked by 28.10.2014 / 18:20
1
answer

Problem installing graphics with ggplot2 R

I'm trying to put a graph in R to display the maximum and minimum values of some variables in addition to a line to mark 0 of y, however the points in the chart go completely out of order. I'm using the following table: cultivar <- c("IB...
asked by 27.08.2016 / 20:17
1
answer

Customize the x-axis values (abscissa) in the geom_smooth or geom_ribbon functions of the ggplot2 package

Although I already have a similar question to the solution presented there scale_x_continuous did not answer my problem. Normally for this I would use the function factor in ggplot(data,aes(x=factor(TEMPO),y=media) howeve...
asked by 16.12.2018 / 13:48
1
answer

Determine size of circles in the legend of a GGPLOT2 chart

Hello I inserted these commands there in the R: library(ggplot2) lm_smooth <- geom_smooth(method = lm, size = 1) qplot(percwhite, percbelowpoverty, data = midwest, weight = popdensity, size = popdensity) + lm_smooth And R returned thi...
asked by 12.08.2018 / 07:44
1
answer

How to insert caption in ggplot maps?

How do I enter the caption and change the map scale to degrees? library("rgeos") library("maptools") library("ggplot2") library("mapproj") cores1 = c('brown2', 'aquamarine2', 'darkgray','darkolivegreen1', 'floralwhite') ggplot() + geom_polyg...
asked by 27.06.2018 / 01:28
1
answer

Use of the summarySE function to construct a graph in ggplot2

Hello, I'm looking for help to improve a script in R. I've developed it with the help of the ggplot2 package. I have some mistakes and I would like opinions. In the study, I evaluated the effect of intra and interspecific interaction between two...
asked by 09.07.2018 / 07:18