sen2r (version 1.2.1)

nn: Replace NULL with character()

Description

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

Usage

nn(x)

Arguments

x

Input variable

Value

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

Examples

Run this code
# NOT RUN {
tryCatch(basename(NULL), error = print) # error
basename(character()) # ok
basename(sen2r:::nn(NULL)) # ok
# }

Run the code above in your browser using DataLab