So I have a large data set which is entitled Site.377 On the x-axis I want the time which is in the X column and then the other 4 columns are entitled Results1, Results2, and Results3. I want to put them all on the same graph to compare how Results1 through 3 compare with each other over time.
What I currently did is:
library(ggplot2)
p <- ggplot(Site.377, aes(x=X, y = Results1) #This was just an attempt to get one of them to post
p + geom_line()
When I would do this, the resulting plot would just have all of the numerical values smushed together and stacked to the side. Seems like a column of numbers overlapped.
Any help would be greatly appreciated.
X Results1 Results2
1 0 .23
2 .83 0
3 .56 .62
4 0 .11

dput(head(Site.377)).reshape2::meltbefore plotting and addingcolourtoaesis probably what you want to do similar to stackoverflow.com/questions/21616688/…dput(head(Site.377[1:10])). Or create data that has the same characteristics and creates the same issue. I'm guessing something like this will workdfm <- melt(Site.377, id.vars = "X"); ggplot(dfm, aes(x = X, y = value, colour = variable)) + geom_line()