I have a 5-row matrix called âdataâ. There are headers.
it look like this :
Row 1 Row2Row3Row4Row5
Line1 â¦â¦â¦â¦
Line2 â¦â¦â¦â¦
Line3 â¦â¦â¦â¦
â¦
Hi everyone. And, Merry Xmas !
I have a 5-row matrix called âdataâ. There are headers.
it look like this :
Row 1 Row2Row3Row4Row5
Line1 â¦â¦â¦â¦
Line2 â¦â¦â¦â¦
Line3 â¦â¦
On Dec 27, 2009, at 9:15 AM, Edouard Tallent wrote:
Hi everyone. And, Merry Xmas !
I have a 5-row matrix called “data”. There are headers.
it look like this :
Row 1 Row2Row3Row4Row5
Line1 …………
Line2 ………
...@lycos.com
Subject: [R] how to create a simple loop ?
To: r-help@r-project.org
Received: Sunday, December 27, 2009, 9:15 AM
Hi everyone. And, Merry Xmas !
I have a 5-row matrix called “data”. There are
headers.
it look like this :
Row 1 Row2 Row3
Row4 Row5
Line1
try this:
mydata - matrix(runif(5000),ncol=5)
indices - list(c(173, 193),
+ c(434, 455),
+ c(699, 724),
+ c(955, 977))
result - lapply(indices, function(.indx){
+ mean(mydata[.indx[1]:.indx[2], 5])
+ })
result
[[1]]
[1] 0.5364535
[[2]]
[1]
5 matches
Mail list logo