HI,
set.seed(25)
dat1 <-
as.data.frame(matrix(sample(c("A","T","G","C"),46482*56,replace=TRUE),ncol=56,nrow=46482),stringsAsFactors=FALSE)
lst1 <- split(dat1,as.character(gl(nrow(dat1),20,nrow(dat1
res <- lapply(lst1,function(x) sapply(x[,1:8],function(y) sapply(x[,9:56],
function(z)
Hi,
May be this what you wanted.
res2 <- lapply(row.names(res[[1]]),function(x)
do.call(rbind,lapply(res,function(y) y[match(x, row.names(y)),])))
length(res2)
#[1] 48
dim(res2[[1]])
#[1] 2325 8
A.K.
On Monday, November 11, 2013 10:20 PM, Yu-yu Ren wrote:
Thank you so much for that scr
HI,
It's not very clear.
set.seed(25)
dat1 <-
as.data.frame(matrix(sample(c("A","T","G","C"),46482*56,replace=TRUE),ncol=56,nrow=46482),stringsAsFactors=FALSE)
lst1 <- split(dat1,as.character(gl(nrow(dat1),20,nrow(dat1
res <- lapply(lst1,function(x) sapply(x[,1:8],function(y) sapply(x[,9:56]
3 matches
Mail list logo