[BioC] calling SAM using siggenes package

Aedin aedin.culhane at ucd.ie
Mon Nov 1 11:45:37 CET 2004


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.



More information about the Bioconductor mailing list