Take a look on ?basename help page.

On Sun, Aug 29, 2010 at 12:07 PM, Hyunchul Kim
<hyunchul.kim....@gmail.com>wrote:

> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[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