dataframe - what is the best way to visualize a table on graph in r -
i have following table(data frame):
week24 week25 week26 under 0.5m 1824 1878 1955 0.5 1m 170 205 211 1to3 117 109 124 3to6 19 19 25 6to10 9 8 8 10to15 4 3 5 15to30 9 13 9 above 30m 19 32 28
i looking best way visualize on graph can have row names under 0.5m:above 30m in x axis .
i have tried barplot() results not good
how can make more informative?
it's not clear me trying obtain. maybe adding legend graph way more descriptive. i've simple data frame show mean:
df <- data.frame(z=c(1,2,3),y=c(2,3,1)) row.names(df) <- c("cat1","cat2","cat3") barplot(as.matrix(df), legend.text = row.names(df), args.legend = list(x = "right"), col = c("blue","green","red"))
if want check better colours, check website: http://www.stat.columbia.edu/~tzheng/files/rcolor.pdf
Comments
Post a Comment