I have a data.frame (df) with 17 rows and 40 columns. I would like to plot all those columns like this:
windows()
plot(NULL,xlim=c(0,17),ylim=c(5000,90000),xaxt='n',xlab="", ylab="")
points(df$c1,type="b",pch=15,col="gold3")
points(df$c2,type="b",pch=15,col="gold3")
.
.
points(df$c40,type="b",pch=15,col="gold3")
I would like to create a loop inside the plot to not have to write all the lines for the 40 columns. I tried different things without success. Thanks in advance!
ggpot2with a long data format?dput(head(df))?