mydata = read.csv("Group+3+puppies.csv")
head(mydata)
X = mydata$Age, Y1=mydata$LP.10, Y2=mydata$LP.11, Y3=mydata$LP.12, Y4=mydata$LP.13, Y5=mydata$LP.14, Y6=mydata$LP.15, Y7=mydata$LP.16, Y8=mydata$LP.1, Y9=mydata$LP.18, Y10=mydata4Average
library(ggplot2)
ggplot(ggplot(mydata, aes(x=Age, y=Weight)) + geom_line(aes(y = Y1), color = "darkblue") + geom_line(aes(y = Y2), color="lightblue") + geom_line(aes(y = Y3), color="darkgreen") + geom_line(aes(y = Y4), color="brown") + geom_line(aes(y = Y5), color="gray") + geom_line(aes(y = Y6), color="black") + geom_line(aes(y = Y7), color="pink") + geom_line(aes(y = Y8), color="yellow") + geom_line(aes(y = Y9), color="red") + geom_line(aes(y = Y10), color="orange")
I get this graph: (the graph I want) graph of data
but I cannot figure out how to add a legend to this, legend would be LP10-LP18 and the average line (all different colors). I have tried the legends() function and I know there is a way to do this using melt(), but I am not sure how to go about this.
data is currently structured like this: image of data with age in days, each number below and LP number is a weight and average is a weight