Hello,

I assume you have imported the dataset. You can use the hist from the
graphics package from the main R program. A tricky part is that the
freq=TRUE (the default) plots frequencies and freq=FALSE plots probability
densities, not percent of the histogram cells. You can sum the counts and
calculate the percent before plotting.

        hist1<-hist(varname, plot=FALSE)
        sum <- sum(hist1$counts)
        hist1$counts <- hist1$counts/sum*100
        plot(hist1, main=paste("Histogram of",deparse(substitute(varname))),
        xlab=deparse(substitute(varname)), ylab="Percent",
        )

Also, if you are new to R, there are very useful manuals and guides at
http://cran.r-project.org/manuals.html . You can look up documention in R,
such as ?hist command for documentation for hist function. 

Regards,
Kyaw Sint (Joe) 


> Dear All,
> 
> I have a massive dataset from which I would like to draw a histogram.
> Any ideas on how to accomplish this?
> 
> Thanks in advance,
>
> Paul

______________________________________________
R-help@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.

Reply via email to