[R] Histogram from a table in R

Robert Baer rbaer at atsu.edu
Wed Apr 4 01:48:59 CEST 2012

intv = c('0-19','10-19','20-29','30-39')
cnts = c(0, 3117, 4500, 2330)
barplot(cnts, space=0, names = intv, xlab='Age Range', ylab = 'Counts', 
main='My Histogram')

-----Original Message----- 
From: gina_alessa
Sent: Tuesday, April 03, 2012 4:08 PM
To: r-help at r-project.org
Subject: [R] Histogram from a table in R

Hi all,

I am new in R. I am trying to make an histogram but I can't figure it out.
I have .cvs table with a lot of data that look like this: I already have the
frequency of each interval (Counts).

Interval   Counts
00:19           0
10:19          3117
20:29         4500
30:39         2330.......

I want to make the histogram with that. At the y axis I want to have the
Counts and at x axis I want to have the intervals.

Thanks in advanced!!!

View this message in context: 
Sent from the R help mailing list archive at Nabble.com.

R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Robert W. Baer, Ph.D.
Professor of Physiology
Kirksville College of Osteopathic Medicine
A. T. Still University of Health Sciences
800 W. Jefferson St.
Kirksville, MO 63501
FAX 660-626-2965 

More information about the R-help mailing list