Re: [R] Using apply for two datasets

2009-01-06 Thread Satoshi Takahama
Perhaps you can convert your matrices to data frames as in: mapply(t.test,as.data.frame(myData1),as.data.frame(myData2)) to test by column and mapply(t.test,as.data.frame(t(myData1)),as.data.frame(t(myData2))) to test by row? - Original Message From: Gang Chen gangch...@gmail.com

Re: [R] how to replace NA values in a list

2008-08-02 Thread Satoshi Takahama
- Original Message From: Shang Liu [EMAIL PROTECTED] Subject: [R] how to replace NA values in a list I have a matrix named spec (see below), it is a 6x3 matrix, and each element of spec is a list. For example, spec[1,wavenumber] is a list, and it contains 1876 numeric numbers and NAs.

Re: [R] Best way to strsplit a column

2008-03-04 Thread Satoshi Takahama
Hi Daniel, After using strsplit() you can call a user-written function to extend the length of each list element to a uniform value and then use do.call() with rbind. For instance, txt - 1:2 + 3:4 + 5 + 6:7 x- readLines(textConnection(txt)) f - function(x) + do.call(rbind, +