# HG changeset patch # User Oleksandr Gavenko # Date 1457216845 -7200 # Node ID 486fcedecf7294e754f0c37a8b0deb540d204ea6 # Parent 7b82258d60a79fdc2545ec62d431031057f773ee Drop column from data frame by name diff -r 7b82258d60a7 -r 486fcedecf72 r.rst --- a/r.rst Sun Mar 06 00:25:36 2016 +0200 +++ b/r.rst Sun Mar 06 00:27:25 2016 +0200 @@ -223,3 +223,7 @@ dfnew <- df[-ncol(df)] # last dfnew <- df[-c(1, 3:4, 7)] # range +Drop column from data frame by name:: + + newdf <- df[ , !(names(df) %in% c("lat", "long"))] +