Skip to content
Prev 76111 / 398502 Next

Attempting to recode elements contained in a list

On Wed, 24 Aug 2005, Greg Blevins wrote:

            
I think s is a data frame, and you are looking at its printout.  There is 
almost certainly no element a.a.  Rather, the data frame has a column a, 
which is probably a matrix with three columns, a, a2 and a3. Use str(s) to 
be sure.  Here is an attempt to create a similar object
"a3")))
scan time      a.a     a.a2     a.a3
1    a    A 5.435430 1.283933 1.546180
2    b    B 5.169964 2.519836 1.568225
3    c    C 3.844045 2.318089 0.772869

If that is the case, you need

s$a[s$a[, "a"] < 3, ] <- NA