Skip to content

Instantly share code, notes, and snippets.

@akshat3096
Created May 14, 2019 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshat3096/22ad49e690c7d99e110fb78e2ad1446e to your computer and use it in GitHub Desktop.
Save akshat3096/22ad49e690c7d99e110fb78e2ad1446e to your computer and use it in GitHub Desktop.
# assign column names
colnames(x) <- c("A", "B", "C")
x
#subset using the names
x[,c('A')]
#using the subset function
subset(x,select=c('A'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment