Answers for "how to delete columns in df in r"

0

drop a column in r data frame

df <- df %>%
  select(-column_to_drop)
Posted by: Guest on February-27-2021
0

how to delete columns in df in r

> df <- data.frame(x=1:5, y=6:10, z=11:15, a=16:20)
> df <- subset (df, select = -c(x:z))
> df
a
1 16
2 17
3 18
4 19
5 20
Posted by: Guest on April-30-2021

Browse Popular Code Answers by Language