Message-ID: <1131154192.2740130.1427884470942.JavaMail.yahoo@mail.yahoo.com>
Date: 2015-04-01T10:34:30Z
From: Alaios
Subject: From replicate to accesing sublists
Dear all,I have a R structure that was created with replicate.The data sets looks to be a matrix with each cell being a list.
str(error_suburban_0[,1],max.level=1)
List of 4
$ vaR :List of 20
..- attr(*, "class")= chr "variogram"
$ Shadowing:List of 2
..- attr(*, "class")= chr "geodata"
$ FIT :List of 1
$ propmodel:List of 12
..- attr(*, "class")= chr "lm"
The error_suburban is a matrix that each field so
error_suburban_0[,1], error_suburban_0[,2], error_suburban_0[,3], error_suburban_0[,4],... and so on, contains the four sublists
$ vaR :List of 20
..- attr(*, "class")= chr "variogram"
$ Shadowing:List of 2
..- attr(*, "class")= chr "geodata"
$ FIT :List of 1
$ propmodel:List of 12
..- attr(*, "class")= chr "lm"
I would like to pick for each of these matrix elements to collect only the $Shadowing sublist
error_suburban_0[,1], error_suburban_0[,2], error_suburban_0[,3], error_suburban_0[,4]... and so on
Right now I am implementing this by a for loop that access each matrix element sequentially.
Can you please advice me if there is a better approach to do that in R?
Regards
Alex
?
[[alternative HTML version deleted]]