This function takes factor vector with multiple levels and selects values for 1 or 2 levels only.
value of factor level to sample
additional value of factor level to sample
This function is ment for sampling specimens for binary classification when they belong to more
than two groups. The aim is to create factor vector with only two levels specifying specimens
in the columns of corresponding microarray expression matrix.
It should be used together with
MiDataSample that samples columns of microarray
expression matrix in the same way.
factor vector with values for 1 or 2 levels only
Elena N. Filatova
1 2 3 4 5 6 7 8 9 10 11 12
#get gene expression and specimen data data("IMexpression");data("IMspecimen") dim(IMexpression) # 100 columns (genes/transcripts) - 89 specimens colnames(IMexpression)[1:10] # look at first 10 columns of matrix - specimens IDs IMspecimen[1:10,] # specimens IDs and group factor - diagnoses in attendant vector # note that specimens in matrix columns are in the same order as specimens in description data # select specimens with only EBV and NORM diagnoses (and sample the description data as well) SampleMatrix<-MiDataSample(IMexpression, IMspecimen$diagnosis, "ebv", "norm") SampleSamples<-MiSpecimenSample(IMspecimen$diagnosis, "ebv", "norm") dim(SampleMatrix)# only 68 specimens with EBV and NORM diagnoses left colnames(SampleMatrix)[1:10] SampleSamples[1:10] # corresponding diagnoses
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.