Skip to content
Prev 44415 / 398526 Next

Apply a function to each cell of a ragged matrix

Hi,
you could simply use functions such as:

time <- dim (3)
for ( i in 1:3) time [i] <- x[i,1]+x[i,2]

the result of time will be the sum of rows.

best regards..

----- Original Message -----
From: "XIAO LIU" <xiaoliu at jhmi.edu>
To: "R Help" <r-help at stat.math.ethz.ch>
Sent: Wednesday, February 18, 2004 12:38 AM
Subject: [R] Apply a function to each cell of a ragged matrix
in factor "f",
I use?
http://www.R-project.org/posting-guide.html