SplitPath | R Documentation |
Split a full path in its components. This is specifically an issue in Windows and not really interesting for other OSs.
SplitPath(path, last.is.file = NULL)
path |
a path |
last.is.file |
logical, determining if the basename should be interpreted as filename or as last directory. If set to |
A list, containing the following components:
normpath |
the normalized path as returned by |
drive |
the drive if the OS is Windows, |
dirname |
the path without directory and without filename |
fullfilename |
the filename including extension |
filename |
the filename without extension |
extension |
the file extension |
Andri Signorell <andri@signorell.net>
dirname
, basename
## Not run: # Windows-specific example
path <- "C:/Documents/Projects/Import/eyestudy.dta"
SplitPath(path)
path <- "C:/Documents/Projects/Import/"
SplitPath(path)
path <- "C:/Documents/Projects/Import"
SplitPath(path) # last entry will be taken as filename
SplitPath(path, last.is.file=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.