I have five sets of data that I need on one plot. I need the x-axis to be lidar and the y-axis to be FPC.
I am using ggplot2
. So far I have the following code:
setwd("C:/r/LIDAR_FPC")
AllLidarvsFPC.df <- data.frame(read.csv("AllLidarvsFPC.csv"))
AllLidarvsFPC = read.csv("AllLidarvsFPC.csv", header=TRUE)
library(ggplot2)
p <- ggplot(AllLidarvsFPC.df, aes(AllLidarvsFPC.df[,1], AllLidarvsFPC.df[,2])) +
geom_point() +
scale_x_continuous(limits=c(-30,100), breaks=c(-30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) +
scale_y_continuous(limits=c(-10,120), breaks=c(-10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100))`
p +
labs(y = "2013 Percentage cover (%) derived from LiDAR") +
labs(x = "2013 FPC (%) derived from Landsat") +
stat_smooth(method = "lm", formula = y ~ poly(x, 5), size = 0.5, col="black")
However, this only plots the first set of data: WildmanFPC
.
I need all the FPC data sets plotted!