[BioC] Expanding table to all possible factors

Daniel Brewer daniel.brewer at icr.ac.uk
Tue Dec 4 13:20:57 CET 2007


Hello,

I have a particular measurement that can take integer values between 0
and 5.  I have multiple measurements for about 50 samples and I working
on a simulation where a random measurement is taken for each sample.
This gives me a 50x10000 table (if there were 10000 runs).  For each run
I use table() to give me the freq of each score.  I would like to join
the frequencies of each run  together so I can find the average
frequency for each score etc.

The problem is that if there is none of that particular score then
table() does no produce a value e.g. suppose there were no 0
measurements the you would get:

 1  2  3  4  5
18 81 55 34 12

rather than
0 1  2  3  4  5
0 18 81 55 34 12

so a simple cbind() would not work.

Does anyone know a way to either get table to fill in empty values or to
do a ragged join or the like.

Many thanks

-- 
**************************************************************
Daniel Brewer, Ph.D.
Institute of Cancer Research
Email: daniel.brewer at icr.ac.uk
**************************************************************

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the a...{{dropped:2}}



More information about the Bioconductor mailing list