nn: Replace NULL with character()

Description Usage Arguments Value Note Author(s) Examples

View source: R/fct_nn.R

Description

Internal function: return character(0) instead of NULL. This is sometimes needed not to return error when applying some functions.

Usage

1
nn(x)

Arguments

x

Input variable

Value

'character(0)' if 'x==NULL', 'x' elsewhere

Note

License: GPL 3.0

Author(s)

Luigi Ranghetti, phD (2019) luigi@ranghetti.info

Examples

1
2
3
tryCatch(basename(NULL), error = print) # error
basename(character()) # ok
basename(shinyCNES:::nn(NULL)) # ok

pobsteta/shinyCNES documentation built on April 28, 2021, 9:43 a.m.