An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130130/6468cf62/attachment.pl>
Percentages in bar plot
3 messages · Naser Jamil, Rui Barradas, PIKAL Petr
Hello, Try barplot(table(stop)/sum(table(stop))) Hope this helps, Rui Barradas Em 30-01-2013 11:34, Naser Jamil escreveu:
Dear R-users, Though it's a silly thing to ask, but I'm not getting a way out. I wish to find the percentage distribution for a data vector 'stop'. The coomand below is giving the frequency distribution. May I know the option to see the percentages instead of frequencies. Similarly, what option I should put in a histogram plot to see the percentages instead of frequencies? --------------------------------------------------------------------- stop<-c(8,6,6,6,8,6,6,8,8,6,6,6,8,8,8) barplot(table(stop)) -------------------------------------------------------------------- Many thanks for your time. Regards, Jamil. [[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.
Hi or use prop.table barplot(prop.table(table(stop))) Regards Petr
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- project.org] On Behalf Of Rui Barradas Sent: Wednesday, January 30, 2013 4:01 PM To: Naser Jamil Cc: R help Subject: Re: [R] Percentages in bar plot Hello, Try barplot(table(stop)/sum(table(stop))) Hope this helps, Rui Barradas Em 30-01-2013 11:34, Naser Jamil escreveu:
Dear R-users, Though it's a silly thing to ask, but I'm not getting a way out. I wish to find the percentage distribution for a data vector 'stop'.
The
coomand below is giving the frequency distribution. May I know the option to see the percentages instead of frequencies. Similarly,
what
option I should put in a histogram plot to see the percentages
instead of frequencies?
--------------------------------------------------------------------- stop<-c(8,6,6,6,8,6,6,8,8,6,6,6,8,8,8) barplot(table(stop)) -------------------------------------------------------------------- Many thanks for your time. Regards, Jamil. [[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.
______________________________________________ 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.