Main data is stored in df
, which will be the data for the bar graph, and returns
V1 V2 V3 ... periphery 0.659 0.626 0.720 ... middle 0.250 0.279 0.819 ... core 0.091 0.077 0.093 ...
then enter GINI coefficients
gco<-c(0.7,1.9,3.1 ... )
draw both bar and line graph
barplot(df,axisnames=FALSE)
we then get the x coordinates for the line graph
bgrp<-barplot(df)
and finally, we draw the line with bgrp
as the x coordinates, and gco
as the y coordinates
lines(bgrp,gco)