Skip to content
Prev 29064 / 29559 Next

Selecting a range of values in a specific column for R ggplot

The aesthetic is looking for the name of the variable, so try subsetting the dataframe in the data portion instead.

newplot <- ggplot(data = GEV[1:4,], aes(x = RL45)) + geom_density(color = "midnightblue") + xlab("Location (mm/day") + ggtitle("Global Location under RCP4.5") + xlim(300, 350)