Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL in mutate #462

Closed
hadley opened this issue Jun 11, 2014 · 3 comments
Closed

NULL in mutate #462

hadley opened this issue Jun 11, 2014 · 3 comments
Assignees

Comments

@hadley
Copy link
Member

hadley commented Jun 11, 2014

Should remove variable, e.g.:

mtcars %>% mutate(cyl = NULL)
@romainfrancois
Copy link
Member

I pushed the basics for that. Couple questions though:

  • what happens if the variable was not in the dataset. Right now, nothing happens. Should this be an error.
  • what happens if we attempt to rm a grouping variable ?Now we get:
> mtcars %>% group_by(cyl) %>% mutate(cyl = NULL)
Erreur : cannot modify grouping variable

We inherit behavior for when we modify the variable. Should we instead get a new message, e.g. "cannot remove grouping variable"

@hadley
Copy link
Member Author

hadley commented Jun 11, 2014

I think both of those are fine.

@romainfrancois
Copy link
Member

Alright. Closing this then.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants