mutate_one | R Documentation |
Make a mutation in one function
mutate_one(x)
## Default S3 method:
mutate_one(x)
## S3 method for class ''function''
mutate_one(x)
## S3 method for class 'ast'
mutate_one(x)
x |
a data.frame, the output of |
the same data.frame as in x
, but with a single mutation
uses astr::ast_modify()
internally
## Not run:
foo <- function(x) {
if (x == 1) x else 5
}
mutate_one(foo)
mutate_one(astr::ast_decompose(foo))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.