calling SAM using siggenes package
0
0
Entering edit mode
Aedin Culhane ▴ 310
@aedin-culhane-500
Last seen 9.6 years ago
Dear Saran, When you use scan("testdata.txt"), the data is not read in as a matrix. It is read in as a vector. Try class(data) or length(data) to see. You will need to convert the vector into a matrix. t.data<-matrix(scan("testdata.txt"), byrow=TRUE, ncol=6) Alternative try using t.data<-read.table("testdata.txt", row.names=1, header=T) # assuming gene/array labels in first col and row check this using dim(t.data) and class(t.data). The number of col, ncol(data) should equal the length(cl). Hope this helps, Aedin So in R I do scan data as follow: > data<-scan("testdata.txt") Then for cl argument, it is a vector containing the class labels of the samples. In this case I set the cl as follows: > cl<-c(0,0,0,1,1,1) So I went ahead and execute sam as follows: So I went ahead and execute sam as follows: > samdata<-sam(data,cl) Then I got the following error: Error in data[, c(x,y)] : incorrect number of dimensions. Any advice on this will be greatly appreciated.
convert convert • 759 views
ADD COMMENT

Login before adding your answer.

Traffic: 1031 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6