Is it possible to index an R list using a character variable and the '$' operator? -
can explain why null in following ?
> = list( 'key'='val') > a$'key' [1] "val" > a$key [1] "val" > key_var = 'key' > a$key_var null i know can
> a[[key_val]] [1] "val" but think double brackets can messy (especially when working nested lists, etc).
Comments
Post a Comment