[R] weighting histograms

Chris Jackson-Jordan jacksonjordancm at gmail.com
Wed Oct 29 00:11:22 CET 2014


I am attempting to weight a histogram with another variable in the
spreadsheet.
does anyone know an easy way of doing this. I have been attempting to use
weighted.hist from the plotrix package but I can't figure out how to use
the other variable as the weight.

I need to weight the Teton_Co_V column in this spreadsheet with GROUP_SIZE
column.

library(plotrix)
training <- read.csv("Biota_subset.csv")
y <- subset(training, select = c(Teton_Co_V))
x <- subset(training, select = c(GROUP_SIZE))
weighted.hist(y, x)

Any suggestions would be great!

Chris


More information about the R-help mailing list