powered by
parent_dir(x = ".", sep = c("/", "\\"))
(x <- c( sys_which("R"), r_home(), r_profile_site(), "c:/", # different behaviour under Windows/Unix "~", "/", "foo/bar/nonexistent", NA )) parent_dir(x)
Run the code above in your browser using DataLab