Displaying 1 result from an estimated 1 matches for "listresult".
2011 Sep 13
2
How to use a variable after $ ($x) for subscripting a list, How to source from a character object (source(x))
Dear R colleagues,
as result of a function a huge list is generated. From this result list
I'd like to extract information.
Think of the list i.e. as an object named "listResult" with the
following form:
[[a]]
[1] [2] [3] [4] [5]
[[b]]
[1] [2] [3] [4] [5]
[[c]]
[1] [2] [3] [4] [5]
where levels=c(a,b,c)
I'd like to extract a data.frame like
a [2]
b [2]
c [2]
What I tried, is a function like this:
library(foreach)
loopExtract <- function(input) {
forea...