[R] error: no such index at level 2
Godmar Back
godmar at gmail.com
Tue Jul 7 19:06:17 CEST 2009
Hi,
I am confused about how to select elements from a list.
I'm trying to select all rows of a table 'crossRsorted' such that the
mean of a related vector is > 0. The related vector is accessible as
a list element l[[i]] where i is the row index.
I thought this would work:
> crossRsorted[mean(q[[ crossRsorted[,1] ]], na.rm = TRUE) > 0, ]
Error in q[[crossRsorted[, 1]]] : no such index at level 2
How can I express: "select only those rows 'r_i' from crossRsorted
where mean(q[[r_i[1]]]) > 0?
Thanks,
- Godmar
More information about the R-help
mailing list