Skip to content
Prev 333007 / 398506 Next

Apply function to every 20 rows between pairs of columns in a matrix

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 <renyangsu at gmail.com> wrote:
Thank you so much for that script, it works great. One additional request; how can I go about binding each of the 2325 matrices for each sample, resulting in 48 matrices of 8 column by 2325 row?
On Mon, Nov 11, 2013 at 10:02 PM, arun <smartpink111 at yahoo.com> wrote:

            
Message-ID: <1384227605.74172.YahooMailNeo@web142606.mail.bf1.yahoo.com>
In-Reply-To: <CAF8+O=paB=UAoa53B0S09-twV=auMe_i7mzqQ_59QvXdcR1QXw@mail.gmail.com>