recode.character2: Modified 'dplyr::recode' function

View source: R/liana_ortho.R

recode.character2R Documentation

Modified 'dplyr::recode' function

Description

Modified 'dplyr::recode' function

Usage

## S3 method for class 'character2'
recode(.x, ..., .default = NULL, .missing = NULL, .missing_fun)

Arguments

.x

A vector to modify

...

<dynamic-dots> Replacements. For character and factor .x, these should be named and replacement is based only on their name. For numeric .x, these can be named or not. If not named, the replacement is done based on position i.e. .x represents positions to look for in replacements. See examples.

When named, the argument names should be the current values to be replaced, and the argument values should be the new (replacement) values.

All replacements must be the same type, and must have either length one or the same length as .x.

.default

If supplied, all values not otherwise matched will be given this value. If not supplied and if the replacements are the same type as the original values in .x, unmatched values are not changed. If not supplied and if the replacements are not compatible, unmatched values are replaced with NA.

.default must be either length 1 or the same length as .x.

.missing

If supplied, any missing values in .x will be replaced by this value. Must be either length 1 or the same length as .x.

.missing_fun

Function to modify any missing homologs/strings 'NULL' by default and any missing values will be discarded. For example, one could be set it to 'str_to_title' to format all symbols, or any other format in a scenario where a homolog dictionary is not available for the organism of interest.

Details

enables to modify unmatched genesymbols


saezlab/liana documentation built on Aug. 10, 2024, 8:14 a.m.