Sunday, January 29, 2017

What is the difference between [ ] and [[ ]] in R?

  > levels(state.region)[2]
[1] "S"
> levels(state.region)[[2]]
[1] "S"


They return the same value, so I don't know what is the difference between them.

No comments:

Post a Comment