Hello again. I am trying to alter the bin size on a histogram where I have
reset the vertical axis to relative frequency, rather than absolute. Beneath
is a simple example (not my real data) of this:
xvals<-rnorm(1000,0,1)
xvals
hist(xvals)
h<-hist(xvals,plot=F)
h
h$counts
h$counts<-h$counts/sum(h$counts)
h$counts
plot(h,freq=T,ylab="Relative Frequency")
This gives me a plot with bin sizes of 0.5 and the relative frequency, but I
cannot reset the bin size as well. I don't know whether the only way to do it
is to reset all the h$mids etc as well but this seems horrendously complicated
and I wonder whether I am missing something simple
Any ideas I would be thankful for Nick Wray
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
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.