Skip to content

Instantly share code, notes, and snippets.

@geofferyzh
Created April 16, 2012 18:08
Show Gist options
  • Save geofferyzh/2400424 to your computer and use it in GitHub Desktop.
Save geofferyzh/2400424 to your computer and use it in GitHub Desktop.
RinAction - R Data Structure - Lists
#################################
# Lists #
#################################
# Creating a list
g <- "My First List"
h <- c(25, 26, 18, 39)
j <- matrix(1:10, nrow = 5)
k <- c("one", "two", "three")
mylist <- list(title = g, ages = h, m=j, k)
mylist
mylist[c(1,2)]
mylist[[2]]
mylist[["ages"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment