Hi, all

I made a simple R script to take the basename of a file without directory
names.

path.splitted <- strsplit('/path/to/a_basename', '/')
path.length <- length(path.splitted[[1]])
basename <- path.splitted[[1]][path.length] # basename <- 'a_basename'

Is there a simple function for this?

something like os.path.basename(a_filename) of python?

Thanks in advance,

Hyunchul

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to