# NOT RUN {
library(Biobase)
set.seed(123)
## Generate toy phenotype and expression data sets
## This example consists of 4 markers and ten patients
n<-10
K<-4
pdat=data.frame(grp=rep(1:0,each=n/2),bp=rnorm(n),ostime=rexp(n),event=rbinom(n,1,0.8))
expdat=matrix(rnorm(K*n),K,n)
## Assign marker names g1,...,gK to the expression data set
## (as row names) and patient ids id1,...,idn to the expression
## data set (as column names) and phenotype data (as row names)
rownames(expdat)=paste("g",1:K,sep="")
patid=paste("id",1:n,sep="")
rownames(pdat)=patid
colnames(expdat)=patid
## Create the ExprSet object
testdat=makeExprSet(expdat,pdat)
class(testdat)
## Check the dimensions of the expression and phenotype data sets
dim(exprs(testdat))
dim(pData(testdat))
## Get sample and marker ids
sampleNames(testdat)
featureNames(testdat)
# }
Run the code above in your browser using DataLab