[R] Query: weighting cells in histogram

2003-10-02 Thread Mårten Bjellerup
I have the 'breaks' for the histogram ('hist') but I want weight the cells instead of using actual observations. I thought that using freq=FALSE implied that the numbers in 'x' were weights but this turned out to be wrong. Any help and/or comment is very much appreciated. Regards, Mårten

Re: [R] Query: weighting cells in histogram

2003-10-02 Thread Thomas W Blackwell
Marten - I don't know exactly what interpretation you have in mind for weights, but if you assign the value of hist() to a variable tmp, you can then assign the component tmp$counts any value you like, and plot the result as a histogram using plot(tmp). See the section Value: in

Re: [R] Query: weighting cells in histogram

2003-10-02 Thread Spencer Graves
hist returns a list, to which you can apply your weights. Alternatively, in R 1.7.1, typing hist [without the quotes ()] at a commands prompt reveals a call to UseMethod. 'methods(hist)' identifies functions hist.default and hist.POSIXt. Typing hist.default prodused the R code,