[R] Percentages in bar plot
Rui Barradas
ruipbarradas at sapo.pt
Wed Jan 30 16:00:57 CET 2013
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.
>
More information about the R-help
mailing list