# HG changeset patch # User Oleksandr Gavenko # Date 1457216936 -7200 # Node ID 1435b942faabb9829fb5077b81b6fb5de8795806 # Parent 486fcedecf7294e754f0c37a8b0deb540d204ea6 Drop column from data frame by name diff -r 486fcedecf72 -r 1435b942faab r.rst --- a/r.rst Sun Mar 06 00:27:25 2016 +0200 +++ b/r.rst Sun Mar 06 00:28:56 2016 +0200 @@ -227,3 +227,7 @@ newdf <- df[ , !(names(df) %in% c("lat", "long"))] + df <- data.frame( a = 1:10, b = 2:11, c = 3:12 ) + df <- subset(df, select = c(a,c)) + df <- subset(df, select = -c(a,c)) +