A version of base::basename that is NULL resistant

basename2(x)

Arguments

x

A character vector of paths

Value

NULL if x is NULL, otherwise, as basename.

Same as base::basename()