Last active
August 29, 2015 14:18
-
-
Save micstr/2681aee2613d7ec0917f to your computer and use it in GitHub Desktop.
Drop row in data table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
dt <- data.table(name = c("M","P","S"), | |
pet = c("dog","cat","fish")) | |
# famous question can be simple | |
# http://stackoverflow.com/questions/12328056/how-do-i-delete-rows-in-a-data-frame | |
dt <- dt[-c(1:2),] | |
# Note it is called subsetting | |
# http://www.ats.ucla.edu/stat/r/faq/subset_R.htm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment