I need to plot a few columns from my dataframe. Generally speaking, in this chart, I need the values of the three selected columns to be plotted as one row, where X
will represent the Release column, as per the following dataframe:
Release,AddedClasses,ModifiedClasses,RemovedClasses,AddedMethods,ModifiedMethods,RemovedMethods,AddedImports,RemovedImports,AddedFields,ModifiedFields,RemovedFields
v1,39,33,0,43,25,0,3,0,21,0,0
v2,48,62,0,88,56,1,35,0,42,0,2
v3,54,93,0,117,95,1,67,0,67,0,2
v4,55,116,29,124,134,5,69,2,121,0,5
For rows, I need to plot values from the following columns: AddedClasses
, ModifiedClasses
, RemovedClasses
.
I tried to plot the graph with the following code:
ggplot(data=ReminderDOPTransformationsResume, aes(x=Release, group = 1)) +
geom_line(aes(y=AddedClasses,color=AddedClasses), size=2) +
geom_point(aes(color = AddedClasses), size=5, stroke = 0, shape = 16) +
geom_line(aes(y=ModifiedClasses,color=ModifiedClasses), size=2) +
geom_point(aes(color = ModifiedClasses), size=5, stroke = 0, shape = 16) +
geom_line(aes(y=RemovedClasses,color=RemovedClasses), size=2) +
geom_point(aes(color = RemovedClasses), size=5, stroke = 0, shape = 16) +
scale_linetype_manual(values=c("solid", "solid")) +
theme_bw(base_size = 24) + theme(plot.title = element_text(hjust = 0.5), legend.title=element_blank())
But when executing, the following error is displayed:
Error: geom_point requires the following missing aesthetics: y
If I remove the geom_point
parts, the graph is plotted, but there are errors in line colors and captions: