I am new to R language, and i'm trying to learn how to create a visualization for the data frame of my students degrees. My table is somewhat like this, but bigger:
names | grade_one | grade_two | grade_three | grade_four |
---|---|---|---|---|
Ana | 5.7 | 6.3 | 4.0 | 5.0 |
Beth | 3.5 | 5.0 | 7.0 | 8.0 |
Rick | 9.0 | 9.0 | 9.0 | 9.0 |
Zoe | 8.0 | 8.7 | 8.0 | 9.0 |
etc
I want to put 'names' on y axis, and the grades 'one','two','three' and so on x axis, and thought about making a line visualization showing the evolution of the students. I would appreciate too if i can give random colors to each name of my 12 students of this classroom to improve viz.
I tried this one and other attempts without success:
ggplot(data=notas)+geom_line(mapping=aes(x=grade_one+grade_two,y=names))
I can do this on sheets but would be great learning how to make on RStudio
Would appreciate any help!
Edit:
I already saw the topic "how-to-create-a-ggplot-bar-chart-with-multiple-columns-of-data-for-y"
Maybe because i'm new to R, idk, i think its slightly different. I want to make a line chart, which each student has its own line on the chart, going from left to right, giving them random colors. I see now that values should be on y axis, the four grades on x axis; and each line showing their performance are labelled on the right side of the chart. But if it's a similar code as the other topic, idk how to adapt.
The ideia behind the line chart in this case, its to compare the evolution of the students between themselves, like "oh, look how at this point the student A exceeded the student B". The bars chart would reproduce more a isolated view of each one, which its not what i seek. Lines crossing each other would be ideal.
Also its not a school homework. I'm the teacher and i'm want to teach them graphical analysis and of course i'm practicing R too.