Creates a file path and also can check/force it to exists in one step. Used mostly in conjunction with here::here, for checking whether a file exists (you've typed the path correctly).

file_path(..., check_exists = TRUE, force_exists = FALSE)

Arguments

...

passed to base::file.path.

check_exists

logical(1) specifying whether to print the path and if it exists locally.

force_exists

logical(1) specifying whether to return an error if the path does not exist.

Value

file path

Examples


file_path("/")
#> / exists
#> [1] "/"