View source: R/path_parent_dir.R
path_parent_dir | R Documentation |
Supply a path, get the parent folder
path_parent_dir(filepath, n_levels = 1, test_existence = FALSE)
filepath |
the file path |
n_levels |
how many levels do you want to go up? default=1 goes up to the parent folder level |
test_existence |
do you want to test whether filepath file exists? |
path_to_file<-"Users/me/folder/subfolder/photo.png"
(path_to_subfolder<-path_parent_dir(path_to_file))
path_parent_dir(path_to_subfolder)
#get same result from:
path_parent_dir(path_to_file,n_levels=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.