Supose I have this tree dataframes, where the first row represents a place and first colum represents a day.
z<-c("a", 2, 3)
x<-c("b",2,3)
y<-c("c",4,5)
w<-c("a",5,3)
v<-c("b",6,5)
r<-c("c",2,1)
q<-c("a",2,5)
p<-c("b",4,5)
t<-c("c",2,1)
g<-c(NA,1,2)
df1<-data.frame(g, z,x,y)
df2<-data.frame(g, w,v,r)
df3<-data.frame(g, q,p,t)
I want to plot several graphics containing the information of the 3 dataframes. I want to represent the values of df1, df2 and df3, in the graphic for each day and place. So for example, I want to plot for day 1, df1, df2, df3, and so on. An the same for place a, i want to plot df1, df2, df3.
ggplot()
instead ofplot()
, it is fairly easy:ggplot() + geom_line(data = df1 ...) + geom_line(data = df2 ...) + geom_line(data = df3 ...)
. You simply specify that eachgeom_line
uses a different data frame, and they are all plotted together. – sam