Description Usage Arguments Details Value See Also Examples
A filename extension object allowing for extensions
containing .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | fs_basename(x = NULL)
## S3 method for class 'fs_basename'
print(x, ...)
as_fs_basename(x, ...)
## Default S3 method:
as_fs_basename(x, ...)
## S3 method for class 'fs_path'
as_fs_basename(x, exts = getOption("fs.exts"))
path_basename(x, exts = getOptions("fs.exts"))
|
x |
object; values to be converted to character. Character values
should omitting the leading |
exts |
character allowable extensions |
fs_basename()
provides a object for handling file/path extensions. This is
a character vector with a subclass ext
that allows methods to be written
for it.
as_fs_basename
returns the extension of its argument x
.
If x
is a
If x
is a fs_path object and exts
is provided, x will identify
extensions will match these extensions first. This allows for extensions
with more than one .
in the filename. Otherwise, fs::path_ext()
is used
and the extension is the character following the last .
in the path or
filename.
Missing extensions are encoded as an empty string (""
).
a fs_basename()
object.
fs:path()()
fs::path_ext()
1 2 3 4 5 6 7 8 9 10 11 | fs_basename( qw(one, two, three) )
file <- "my_file.rds"
as_fs_basename(file)
file <- file %>% fs::path()
as_fs_basename(file)
as_fs_basename(file, c('sql', 'rds', 'sql.rds'))
"iris.rds" %>%
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.