[R] Plotting dataset

JS Huang js.huang at protective.com
Sat Feb 7 00:43:26 CET 2015


Hi,

  Here is my implementation.  Modify the data as follows so that it can be
read with read.table and save as "rHelp_20151206.txt" under working
directory.

female male vowel language 
391 339 i W.Apache 
561 512 e W.Apache 
826 670 a W.Apache 
453 427 o W.Apache 
358 291 i CA.English 
454 406 e CA.English 
991 706 a CA.English 
561 439 o CA.English 
398 324 u CA.English 
334 307 i Ndumbea 
444 361 e Ndumbea 
796 678 a Ndumbea 
542 474 o Ndumbea 
333 311 u Ndumbea 
343 293 i Sele 
520 363 e Sele 
989 809 a Sele 
507 367 o Sele 
357 300 u Sele 

  Then read following the step below to get the plot:
> plot.case <- read.table("rHelp_20150206.txt",header=TRUE)
> language.vowel <- paste(language, vowel, sep="/")
> plot.case <- data.frame(plot.case,language.vowel)
> ggplot(plot.case,aes(x=language.vowel,y=female)) +
> geom_bar(stat="identity",fill="lightblue",color="black") + coord_flip()




--
View this message in context: http://r.789695.n4.nabble.com/Plotting-dataset-tp4702896p4702912.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list