Description Usage Arguments Value Note Author(s) Examples
Many files have base and extensions in their names, for instance for the
file mybook.pdf
, the base is mybook
and the extension is
pdf
. basefilename
extname
functions extract these
information from one or more file names.
1 |
x |
Character vector of file names; other classes will be coereced to characters |
ifnotfound |
If no extension name was found, the value to be returned.
Default is |
lower.case |
Logical, should the names returned in lower case? |
The base file name or the extension as characters, of the same
length as the input file name character. In case that a file name does not
contain a extension, NA
will be returned.
In case there are multiple dots in the input file name, the last field
will be taken as the extension, and the rest as the base name. For instance
for file test.out.txt
, returned base name is test.out
and
extension is txt
.
Jitao David Zhang <jitao_david.zhang@roche.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | extname("mybook.pdf")
extname("sequence.in.fasta")
extname(c("/path/mybook.pdf", "test.doc"))
extname("README")
extname("README", ifnotfound="")
extname("/path/my\ home/Holiday Plan.txt")
basefilename("mybook.pdf")
basefilename("sequence.in.fasta")
basefilename(c("/path/mybook.pdf", "test.doc"))
basefilename("README")
basefilename("/path/my\ home/Holiday Plan.txt")
basefilename("myBook.pdf", lower.case=TRUE)
extname("myBook.PDF", lower.case=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.