Simplify ifelse process

ifnotNA(var)

Arguments

var

target variable (likely character type)

Value

if the var length is 0 then the function returns NA, otherwise it returns the input parameter.