Caitlin
2011-May-03 17:35 UTC
[R] Constructing a histogram with words as labels as height as frequency?
Hi all. I need to construct a plot showing words on the x-axis and how many times each word was given as a verbal response on the y-axis as solid bar (frequency). Is there a convenient function to do this in R? I considered hist(), but I'm not sure how to construct the text file. Example: apple, 2 pear, 14 house, 1 beach, 5 computer, 15 Thanks, ~Caitlin [[alternative HTML version deleted]]
Greg Snow
2011-May-03 17:52 UTC
[R] Constructing a histogram with words as labels as height as frequency?
?barplot -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Caitlin > Sent: Tuesday, May 03, 2011 11:36 AM > To: r-help at r-project.org > Subject: [R] Constructing a histogram with words as labels as height as > frequency? > > Hi all. > > I need to construct a plot showing words on the x-axis and how many > times > each word was given as a verbal response on the y-axis as solid bar > (frequency). Is there a convenient function to do this in R? I > considered > hist(), but I'm not sure how to construct the text file. Example: > > apple, 2 > pear, 14 > house, 1 > beach, 5 > computer, 15 > > Thanks, > > ~Caitlin > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Jim Lemon
2011-May-04 07:22 UTC
[R] Constructing a histogram with words as labels as height as frequency?
On 05/04/2011 03:35 AM, Caitlin wrote:> Hi all. > > I need to construct a plot showing words on the x-axis and how many times > each word was given as a verbal response on the y-axis as solid bar > (frequency). Is there a convenient function to do this in R? I considered > hist(), but I'm not sure how to construct the text file. Example: > > apple, 2 > pear, 14 > house, 1 > beach, 5 > computer, 15 >Hi Caitlin, barp(caitlinsdata[,1],names.arg=caitlinsdata[,2] Jim