path_clean() is wrapper around path_tidy(), path_expand_r() (or path_expand()), and path_norm(). It tidies, then expands, then normalizes the given path(s).

path_clean(path, home = c("r", "user"))

Arguments

path

A character vector of one or more paths.

home

The home directory definition to use when expanding a path. The default is to use R's definition, but the system definition of the user's home directory can also be used. These are equivalent to calling path_expand_r() or path_expand(), respectively.

Value

The cleaned path(s) in an fs_path object, which is a character vector that also has class fs_path