I am trying to plot a line graph in R with multiple variables as the following data frame: Data Frame
I would like to get a plot as the next one: Plot
I have tried different methods but not being able to get this done, any suggestion?
I am trying to plot a line graph in R with multiple variables as the following data frame: Data Frame
I would like to get a plot as the next one: Plot
I have tried different methods but not being able to get this done, any suggestion?
This should get you started, but I would tend to agree with Michael that a line plot may not be the way to go.
test <- data.frame(Name = c('M','D','T','H','P'),
Ball_Control = c(48,31,23,34,22),
Dribbling = c(30,13,13,10,12),
Marking = c(10,13,11,12,11),
Sliding_Tackle = c(11,13,16,18,12))
library(ggplot2)
library(tidyr)
df.gathered <- gather(test,key = 'Parameter',value = 'Value',2:5)
ggplot(df.gathered, aes(x = Parameter, y = Value, group = Name, col = Name))+geom_line()+
scale_y_continuous(limits = c(0,60), breaks = seq(0,60,10))