View source: R/differential_nichenet.R
mutate_cond | R Documentation |
mutate_cond
Change values in a tibble if some condition is fulfilled. Credits: https://stackoverflow.com/questions/34096162/dplyr-mutate-replace-several-columns-on-a-subset-of-rows.
mutate_cond(.data, condition, ..., envir = parent.frame())
.data |
Data frame / tibble |
condition |
A condition that need to be fulfilled. |
... |
The change that need to happen if condition fulfilled – through the use of 'dplyr::mutate()' |
envir |
parent.frame() by default |
A tibble
## Not run:
mutate_cond(df, a == 3, b = 4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.