[BioC] Help on alternative and efficient data frame manipulation
Zhu, Lihua (Julie)
Julie.Zhu at umassmed.edu
Wed Dec 28 21:01:41 CET 2011
Hi,
I have a data frame consisting of 5000 columns and 16000 rows. I would like
to convert all values x in column 4 to 5000 to 1 if x >0. The following code
works but it is very slow. Are there more efficient ways to modify large
number of entries in a data frame? Many thanks for your kind help!
id <- 4:ncol(mydata)
for (i in id) {mydata[mydata[,i]>0,i]=1}
Best regards,
Julie
More information about the Bioconductor
mailing list