standardizePath-character-method: Standardize Path

Description Usage Arguments Value Author(s) References See Also Examples

Description

See standardizePath.

Usage

1
2
3
## S4 method for signature 'character'
standardizePath(path = ".", sep = c("/", "\\"),
  shortform = FALSE, ...)

Arguments

path

character. Vector of file paths. Default: files in current directory.

sep

character. String separator betwen directory levels in the output.

shortform

logical. Dimension: 1. Use shortforms (TRUE) for getwd() (i.e. ".", dirname(getwd() (i.e. ".." and HOME (i.e. "~") or not (FALSE, default).

...

Further arguments to be passed to subsequent functions/methods.

Value

matrix with three columns named "dirname", "filename" and "extension". strip_extension returns a character vector of the second column, and get_extension returns a character vector of the third column. recompose_path returns a character vector of paths.

Author(s)

Janko Thyson janko.thyson@rappster.de

References

https://github.com/Rappster/filesystr

See Also

standardizePath

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

standardizePath()

path <- c(".", "./dir", "..", "../dir", "~", "~/file.txt", R.home(), 
            tempdir(), "nonex", "nonex/", "nonex/file.txt", 
            "nonex/file.txt/", "", NA)
standardizePath(path = path, sep = "\\")
try(standardizePath(path = path, sep = "notallowed"))
standardizePath(path = path, shortform = TRUE)

standardizePath(".")
standardizePath(path = character())
standardizePath(path = "")
standardizePath(path = NA_character_)


## End(Not run)

rappster/filesystr documentation built on May 26, 2019, 11:17 p.m.