Hi R-users
I am having troubles accessing elements after the $ symbol. Reproducible
example:
>test <- data.frame (first=1:10, second=11:20, third=21:30)
>test$first #this works fine
but when I try
>interest <- "first"
>test$interest # does not seem to work
Could you tell me why that happens and show how to do instead?
Thanks so much
Lorenzo
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.