weighted.hist(x,w,breaks="Sturges",col=NULL,plot=TRUE,
freq=TRUE,ylim,ylab=NULL,...)
barplot
.x
.
equidist - Whether all ranges are equal to less than 1000th of the total range.weighted.hist
calculates the weighted counts of values falling
into the ranges specified by breaks
. Instead of counting each
value as 1, it counts the corresponding value in w
(the weight).
breaks
may be specified by a monotonically increasing vector
of numbers that are interpreted as the endpoints of the ranges, a
single number representing the number of ranges desired or the name
of the function to calculate the ranges (see hist
).
If a vector of numbers is passed that does not include all values in
x
, the user is warned. If the ranges are not equal, a warning
will be displayed if freq
is TRUE or the heights of the bars
will be adjusted to display areas approximately equal to the counts
if freq
is FALSE.hist
testx<-sample(1:10,300,TRUE)
testw<-seq(1,4,by=0.01)
weighted.hist(testx,testw,breaks=1:10,main="Test weighted histogram")
Run the code above in your browser using DataLab