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