Quantcast

Histogram from a table in R

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Histogram from a table in R

gina_alessa
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!!!


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Histogram from a table in R

Peter Alspach-2
Tena koe

Possibly barplot() is what you are after.

?barplot

HTH ....

Peter Alspach

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of gina_alessa
Sent: Wednesday, 4 April 2012 9:08 a.m.
To: [hidden email]
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: http://r.789695.n4.nabble.com/Histogram-from-a-table-in-R-tp4530175p4530175.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.

The contents of this e-mail are confidential and may be subject to legal privilege.
 If you are not the intended recipient you must not use, disseminate, distribute or
 reproduce all or any part of this e-mail or attachments.  If you have received this
 e-mail in error, please notify the sender and delete all material pertaining to this
 e-mail.  Any opinion or views expressed in this e-mail are those of the individual
 sender and may not represent those of The New Zealand Institute for Plant and
 Food Research Limited.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Histogram from a table in R

Robert Baer
In reply to this post by gina_alessa
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: [hidden email]
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:
http://r.789695.n4.nabble.com/Histogram-from-a-table-in-R-tp4530175p4530175.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.


------------------------------------------
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
660-626-2322
FAX 660-626-2965

______________________________________________
[hidden email] 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.
Loading...