Skip to content
Prev 318845 / 398503 Next

boxplot with frequencies(counts)

On 03/06/2013 12:45 AM, km wrote:
Hi KM,
We must assume that the "type" variable is to be used as a value, 
otherwise you would want something like a frequency plot by two factors 
of position and type. (If this is the case, I would suggest a nested bar 
plot). Here is a fairly awful kludge that will get you a boxplot (tdf is 
your "table"):

reprow<-function(x) return(matrix(rep(x[1:2],x[3]),ncol=2,byrow=TRUE))
replist<-apply(as.matrix(tdf),1,reprow)
repmat<-replist[[1]]
for(rep in 1:length(replist)) repmat<-rbind(repmat,replist[[rep]])
boxplot(repmat[,2],repmat[,1])

With apologies
Jim