Skip to content

Instantly share code, notes, and snippets.

@lvalnegri
Last active July 21, 2017 15:08
Show Gist options
  • Save lvalnegri/bd8848d3133f244f9d016ac8c5cebe20 to your computer and use it in GitHub Desktop.
Save lvalnegri/bd8848d3133f244f9d016ac8c5cebe20 to your computer and use it in GitHub Desktop.
small notes about data structures in R
  • To select elements from embedded lists, it could be better to use chained selection.
    If, say: lst <- list('a' = list('a1' = 11, 'a2' = 12), 'b' = list('b1' = 21, 'b2' = 22))
    then: lst[['a']][['a2']] == lst[[c('a', 'a2')]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment