set-if-na: Set If or If Not 'NA'

set-if-naR Documentation

Set If or If Not NA

Description

Set a default value depending on if an object is NA

Usage

x %NA% y

x %na% y

x %!NA% y

x %!na% y

Arguments

x

An object to test

y

A default value

Value

For %NA%: y if x is NA; otherwise x

For %!NA%: y if x is not NA; otherwise x

Examples

# Set if NA
1 %NA% 2
NA %NA% 2

# Set if *not* NA
1 %!NA% 2
NA %!NA% 2


SeuratObject documentation built on May 29, 2024, 12:31 p.m.