If I want to scale a histogram ie multiply by a constant how would I do this? Thanks [[alternative HTML version deleted]]
On 12/10/2009 04:01 PM, terry johnson wrote:> If I want to scale a histogram ie multiply by a constant how would I do > this? Thanks > > [[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. >Without further details I would guess: suppose tmp <- runif(100,0,100) hist(tmp) then hist(tmp*.01) will rescale the range from 0 to 100 to 0 to 1 Stephan
On 11/12/2009, at 4:01 AM, terry johnson wrote:> If I want to scale a histogram ie multiply by a constant how would > I do > this? ThanksThis question is pretty vague. Please read the posting guide. If you want to rescale the y-axis you could do something like: > set.seed(333) # Only half evil. > x <- rnorm(300) > h <- hist(x,plot=FALSE) > h$counts <- h$counts*42 > plot(h,ylab="Rescaled counts") If you want to rescale the x-axis, see the posting by Stephan Devriese. cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}