Learn R Programming

reproducible (version 3.2.1)

basename2: A version of base::basename that is NULL resistant

Description

A version of base::basename that is NULL resistant

Usage

basename2(x)

Value

NULL if x is NULL, otherwise, as basename.

Same as base::basename()

Arguments

x

A character vector of paths

Examples

Run this code
basename2(NULL)
basename2("/home/user/file.txt")

Run the code above in your browser using DataLab