

For each student, we want to plot a line to reflect how his/her scores change over different quizzes, each point is the score of one quiz for a certain students. Each row contains one student's data: first column is the quiz number, then the rest of columns are his/her scores. You can imagine there are many students in the class and we have their scores of several quizzes. However, I got an empty graph which has no point nor line.Ĭan anyone help me to see what's wrong with my procedure? Thank you in advance! Ggplot() + geom_line(data=melted, aes(x="time", y="value", group="variable")) Then plot the data using the following statment: I first melt the data into a "long-format": I followed some examples on stack overflow and tried to use reshape2 and ggplot2 to do this plot: To generate a similar data, you could use the following code: (If you need further explanation of the data format, see P.S. In the data above, there are 4 lines, each line consists of 5 points. Other columns are y values of points in different lines. Then, you start adding more lines or points to the.

I would like to use the "time" column as the x value. To plot two or more graphs in the same plot, you basically start by making a typical basic plot in R. I am trying to plot multiple lines using ggplot2.
