Displaying 1 result from an estimated 1 matches for "nosamp".
Did you mean:
noarp
2008 Jun 12
1
Data.matrix fail to convert data.frame into matrix
...the following codes, I attempt to convert
the data.frame into a matrix.
However I notice that data.matrix function doesn't
seem to work.
__ BEGIN__
dat <- read.table("mydata", comment.char = "!" , na.strings = "null");
# Select n-genes by random sample
# n = 1
nosamp <- 1
geneid <- sequence(nrow(dat))
geneid.samp <- sample(geneid,nosamp)
geneid.samp
gexp<- dat[geneid.samp,]
gexp.arr <- data.matrix(gexp, rownames.force = NA)
print(is.matrix(gexp.arr))
print(gexp.arr)
__END__
Yielding this output:
__BEGIN__
> print(is.matrix(gexp.arr))
[1]...