mutate_if_present: Perform mutations only if specific column names are present

View source: R/data_manip_utils.R

mutate_if_presentR Documentation

Perform mutations only if specific column names are present

Description

Note that columns required to be present need not be involved in the mutations.

Usage

mutate_if_present(.data, names, ...)

Arguments

.data, ...

These have the same meaning as in dplyr::mutate()

names

If .data does not contain all of these names as columns, it will be returned unmodified.

See Also

dplyr::mutate(). Not to be confused with dplyr::mutate_if(), which mutates columns that match a specific filter criteria.


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.