[R] alternative to subset(dataframe, select = - column) in R

Luigi Marongiu m@rong|u@|u|g| @end|ng |rom gm@||@com
Fri Sep 24 16:09:54 CEST 2021


Hello,
this is a very simple question but...
what is the vector alternative to `subset(dataframe, select = - column)`?
I tried with:
```
> x = new[-ID]
Error in `[.data.frame`(new, -ID) : object 'ID' not found
> x = new[-"ID"]
Error in -"ID" : invalid argument to unary operator
> x = new[[-"ID"]]
Error in -"ID" : invalid argument to unary operator
> x = new[-["ID"]]
Error: unexpected '[' in "x = new[-["
```
Thank you



More information about the R-help mailing list