Entering edit mode
Alice LE BARS
▴
10
@alice-le-bars-2159
Last seen 10.2 years ago
Dear all,
I have trouble using the pamr.listgenes function in pamr package. When
I
try to use it, I have the following error :
Error in dimnames(res) <- list(NULL, c("id", gnhdr, schdr)) :
length of 'dimnames' [2] not equal to array extent
I check if it was my data, but using the example for generating the
data,
the problem remain.
Did someone have an idea?
I use a limited dataset of 12 samples and 14 genes
# With my originaly data
Val =
matrix(as.numeric(unlist(tableEntr[2:dim(tableEntr)[1],2:dim(tableEntr
)[2]])),nrow=(dim(tableEntr)[1]-1))
LabelClasse = rep(c("CR","TOL"), each=6 )
ListeW = list(x=Val,y=LabelClasse)
entrainement = pamr.train(ListeW)
pamr.listgenes(entrainement,ListeW,1)
#with the example
set.seed(120)
x <- matrix(rnorm(1000*20),ncol=20)
y <- sample(c(1:4),size=20,replace=TRUE)
mydata <- list(x=x,y=factor(y))
train = pamr.train(mydata)
pamr.listgenes(train,mydata,1)
Thanks for help
Alice.