clean_path: standardize path to file

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

View source: R/lasSampleCompare.R View source: R/clean_path.R

Description

paths often have extra slashes, or in opposing directions. This function standardizes slashes

Usage

1
2
3
4
5
clean_path(path, backslash = T, force_endslash = F)

backslash(path)

forwardslash(path)

Arguments

path

supply a path

backslash

T/F backslashes or forwardslashes?

force_endslash

T/F cap path with slash?

Details

standardizes slashes - forward or back


Revision History

1.0 2015 Jan 29 Roxygen header prepared

Value

updated path

Author(s)

Jacob Strunk <jstrunk@fs.fed.us>

See Also

grep
gsub

Examples

1
2
3
4
5
6
7
       clean_path("c:\\temp",F,F)
       clean_path("c:\\temp",T,F)
       clean_path("c:\\temp",T,T)

       clean_path("c:/temp/",F,F)
       clean_path("c:\\temp\\\\",T,F)
       clean_path("c:\\temp\\\\",T,T)

jstrunk001/lasR documentation built on April 20, 2020, 7:24 a.m.