I have a table made in Excel, converted to a dataframe it looks like this:
Sistema DetNP DetProg Indisp Total TotalMax
1 MOTOR EQUIPO MOVIL 744 977 3.54% 1721 977
2 SISTEMA CHASIS 36 873 1.87% 909 873
3 TREN DE POTENCIA 247 527 1.59% 774 527
4 PMs 0 736 1.52% 736 736
5 SUSPENSION Y RUEDAS 100 346 0.92% 446 346
6 SISTEMA HIDRAULICO 118 181 0.62% 299 181
7 SISTEMA ELECTRICO 24V 144 30 0.36% 174 144
8 CABINA 116 20 0.28% 136 116
9 SISTEMA LUBRICACION 24 40 0.13% 64 40
10 SISTEMA DE FRENOS 17 44 0.13% 61 44
From this, i need to make this chart using only ggplot if possible:
So far by now using reshape and melting i reached until this, but im not able to plot the lines:
molten <- melt(dataset, id = c("Sistema","Indisp","Total","TotalMax"))
ggplot(data=molten, aes(x=time, y=Total, fill=variable)) + geom_bar(stat="identity", position=position_dodge()) + geom_line(aes(x=Sistema, y=Indisp),stat="identity")
Thanks for your help