Entering edit mode
Anthony Rossini
▴
530
@anthony-rossini-10
Last seen 10.1 years ago
Something to be careful of -- I've worked around it, but don't have
time for the real patch.
The problem:
split(exprSet,factor) fails, while
split(exprSet,as.numeric(factor)) works:
The example:
R : Copyright 2002, The R Development Core Team
Version 1.5.1 (2002-06-17)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.
R is a collaborative project with many contributors.
Type `contributors()' for more information.
Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.
[Previously saved workspace restored]
> options(STERM='iESS', editor='emacsclient')
Warning message:
using .GlobalEnv instead of package:annotate
> library(Biobase)
Loading required package: methods
Expanding the signature to include omitted arguments
in definition: j = "missing"
Attaching package `Biobase':
The following object(s) are masked from package:base :
split
> geary
Expression Set (exprSet) with
4132 genes
8 samples
phenoData object with 2 variables and 8 cases
varLabels
animal: Animal
type: Specimen Type
> split(geary,geary$animal)
$"1"
Expression Set (exprSet) with
4132 genes
2 samples
phenoData object with 2 variables and 2 cases
varLabels
animal: Animal
type: Specimen Type
$"2"
Expression Set (exprSet) with
4132 genes
2 samples
phenoData object with 2 variables and 2 cases
varLabels
animal: Animal
type: Specimen Type
$"3"
Expression Set (exprSet) with
4132 genes
2 samples
phenoData object with 2 variables and 2 cases
varLabels
animal: Animal
type: Specimen Type
$"4"
Expression Set (exprSet) with
4132 genes
2 samples
phenoData object with 2 variables and 2 cases
varLabels
animal: Animal
type: Specimen Type
> geary$animal
[1] 1 1 2 2 3 3 4 4
> split(geary,geary$type)
$Gunk
Expression Set (exprSet) with
2066 genes
8 samples
phenoData object with 2 variables and 8 cases
varLabels
animal: Animal
type: Specimen Type
$Other
Expression Set (exprSet) with
2066 genes
8 samples
phenoData object with 2 variables and 8 cases
varLabels
animal: Animal
type: Specimen Type
> geary$type
[1] Gunk Other Gunk Other Gunk Other Gunk Other
Levels: Gunk Other
> split(geary,as.numeric(geary$type))
$"1"
Expression Set (exprSet) with
4132 genes
4 samples
phenoData object with 2 variables and 4 cases
varLabels
animal: Animal
type: Specimen Type
$"2"
Expression Set (exprSet) with
4132 genes
4 samples
phenoData object with 2 variables and 4 cases
varLabels
animal: Animal
type: Specimen Type
> q()
--
A.J. Rossini Rsrch. Asst. Prof. of
Biostatistics
U. of Washington Biostatistics rossini@u.washington.edu
FHCRC/SCHARP/HIV Vaccine Trials Net rossini@scharp.org
-------------- http://software.biostat.washington.edu/
----------------
FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use
Email
UW: Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
(my tuesday/wednesday/friday locations are completely unpredictable.)