getExtension | R Documentation |
Extract file name, extension and basename ofrom a path.é
getExtension(x, sep = .Platform$file.sep) getFilename(x, sep = .Platform$file.sep) getName(x, sep = .Platform$file.sep) getBasename(x, sep = .Platform$file.sep) getLocation(x, sep = .Platform$file.sep) getDetails(x, sep = .Platform$file.sep)
x |
a character string. Note that |
sep |
file separator, default used the platform-specific file separator see |
For more functionalities, have a look at package fs.
Extract the file extension a character string (e.g. a path).
getFilename()
: Extract the file name from a character string, that is the base name and the file extension
getName()
: Extract the name of a file or a directory from a character string.
getBasename()
: Extract the base name of a file from a character string.
getLocation()
: Extract the location of the parent folfder from a character string.
getDetails()
: Return a data frame with basic information for all elements of a vector of paths.
getExtension("path1/path2/foo.R") getFilename("path1/path2/foo.R") getBasename("path1/path2/foo.R") getLocation("path1/path2/foo.R") getDetails("path1/path2/foo.R") getDetails(list.files(recursive = TRUE)) getExtension("foo.R") getBasename("foo.R")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.