fileparts | R Documentation |
Return filename parts.
fileparts(pathname)
pathname |
character string representing pathname to be parsed |
Determines the path, filename, extension, and version for the specified file.
The returned ext
contains a dot (.) before the file extension.
The returned versn
is always an empty string as the field is provided
for compatibility with its namesake's results.
Returns a list with components:
pathstr |
character string representing directory path |
name |
character string representing base of file name |
ext |
character string representing file extension |
versn |
character string representing version. Unused |
Returns same insane results as does its namesake when handling relative
directories, UNIX hidden files, and tilde expansion. Hidden files are
returned with name
containing a zero length vector and ext
containing the actual name.
For best results, use this routine to process files, not directories.
P. Roebuck proebuck1701@gmail.com
fullfile
## Rename dot-txt file as dot-csv
ans <- fileparts("/home/luser/foo.txt")
fullfile(ans$pathstr, paste(ans$name, "csv", sep=".")) # /home/luser/foo.csv
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.