On Sat, 14 Jun 2014 10:59:07 AM 오건희 wrote: > Hi > > I got a wrong graph when I typed " qplot(names(termFrequency),termFrequency, > geom="bar", xlab="Terms",stat="bin")+coord_flip() " > > The frequency weren't displayed on the graph. what's the problem? > > I attached the screen shot to this e-mail. > Hi 오건희 , You seem to be supplying a character vector - names(termFrequency) - as the "x" argument to qplot. Making a wild guess that these names are actually numbers, perhaps:
as.numeric(names(termFrequency)) will work. If the wild guess was wrong, perhaps you want to specify termFrequency as the first argument. When something like this happens, it is often helpful to explicitly name your arguments: qplot(x=names(termFrequency),y=termFrequency, geom="bar", xlab="Terms",stat="bin")+coord_flip() This will sometimes give a meaningful error message that helps to identify what has gone wrong. Jim ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.