View source: R/drive_find_path.R
drive_find_path | R Documentation |
Simulates Finder/File Explorer functionality by repeated calls to googledrive::drive_find()
. Allows relative paths via hybrid navigation of local virtualized Google Drive for Desktop paths by going to a local lesson directory, pulling up the front-matter.yml and finding the Google ID in order to access the relative path you requested through the Drive API.
drive_find_path(
drive_path,
WD = NULL,
drive_root = NULL,
exact_match = TRUE,
single_result = TRUE,
checkWD = TRUE,
raw_results = FALSE,
...
)
drive_path |
If you provide a dribble, it gets passed right back out. Otherwise, you can give a character string in the form "DRIVE/directory/subdirectory".
|
WD |
|
drive_root |
A Google drive path reference (not a local or virtualized path). Will be ignored unless relative path provided ("../folder1"), where drive_root will be substituted for "..". Can be:
|
exact_match |
logical; Do you want an exact match for the file name of the path? (only applies to the final FILENAME part of the path; i.e 'folder/folder/FILENAME_w_different_suffix'); default=TRUE |
single_result |
logical; do you want to force a single result (i.e. throw an error if there is more than one match)?; default=TRUE |
checkWD |
do you want to run |
raw_results |
logical; used for error checking on path resolution. If T, will export the full list of results of found paths, rather than just a tibble of the final target result. Default=FALSE |
... |
other arguments passed to |
Other Google Drive Functions:
drive_contents()
,
drive_copy_missing_files()
,
drive_cp_dir()
,
drive_get_info()
,
drive_inSync()
,
drive_new_from_template()
,
drive_open()
,
init_lesson_meta()
,
update_teach_links()
## Not run:
#ABSOLUTE PATHS
#path to a drive file on your personal Google Drive
drive_find_path("~/folder_in_my_personal_drive/filename")
#path to a network drive folder
(p <- drive_find_path("GP-Studio/Edu/Lessons/geneticrescue_sci"))
#show contents of that drive folder
p %>% drive_contents()
#RELATIVE PATH to a particular lesson subfolder
#only works if you have Google Drive for Desktop set up with permissions to GP-Studio
drive_find_path("../assets",pick_lesson()) %>% drive_contents
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.