Internal function: return character(0) instead of NULL. This is sometimes needed not to return error when applying some functions.
nn(x)
Input variable
character(0) if x==NULL, x elsewhere
character(0)
x==NULL
x
# 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