Create a histogram for weighted values

前端 未结 3 553
醉酒成梦
醉酒成梦 2020-12-06 16:33

If I have a vector (e.g., v<-runif(1000)), I can plot its histogram (which will look, more or less, as a horizontal line because v is a sample f

3条回答
  •  失恋的感觉
    2020-12-06 17:05

    Package plotrix has a function weighted.hist which does what you want:

    w<-seq(1,1000)
    v<-sort(runif(1000))
    weighted.hist(v, w)
    

    Example of <code>weighted.hist</code>

提交回复
热议问题