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
To: Henrique Dallazuan
Suppose I want to have a regexp match against a string, and return all
the matching substrings in a vector of strings.
regexp <- "[ab]+"
strlist <- c( "abc", "dbabddadd", "aaa" )
matches <- gregexpr(regexp,strlist)
With this input, I'd want to return list( list("ab"), list("ab", "a"),
li
- 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
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,
+
Hi Derek,
I love this function as well. If 'mat' is your matrix,
> (mat <- matrix(1:15,ncol=3))
[,1] [,2] [,3]
[1,]16 11
[2,]27 12
[3,]38 13
[4,]49 14
[5,]5 10 15
how about
> expandedDF <- do.call(`expand.grid`,as.data.frame(mat))
> head(expand
Hi Taka,
I was just trying to do this yesterday and ran into the same problem (compiling
R 2.6.1 on Gutsy Gibbon). Apparently this happens on Debian/Ubuntu
distributions because the developer install is separate from the user install.
Basically, to address the configure error:
"--with-readline
6 matches
Mail list logo