Locate SharePoint project root directory
find_project_root.RdSearches for the root directory of a SharePoint (Teams) project synced to a local drive, by looking for the "Resource Systems Group" folder and matching the project name. Use to programmatically locate project folders for file I/O and automation.
Details
Searches for "Resource Systems Group" directory under the specified root (default: C:/Users/
). Recursively searches for project folder by name or partial name within RSG directory.
Handles multiple or missing matches with informative errors.
Returns path(s) to project root directory as character vector.
Does not modify any files or directories.
See also
scripts/utilities/find_project_root.R
Other io utilities:
clean_data_dict(),
cut_and_label(),
db_table_has_geometry(),
fetch_acs(),
fetch_all_hts_tables(),
fetch_from_db(),
fetch_hts_table(),
fetch_pums(),
fetch_study_region(),
fix_value_labels_on_load(),
get_db_table_name(),
print_params(),
pums_checksum(),
read_from_db(),
read_pums_codebook(),
record_checksum(),
sampled_latlon_to_bg()
Examples
## Not run:
find_project_root('20007 Skagit HTS')
#> Warning: [ENOENT] Failed to search directory 'C:/Users/runner': no such file or directory
#> Error in find_project_root("20007 Skagit HTS"): Could not find directory matching "Resource Systems Group" in C:/Users/runner.
#> Maybe include "Documents" in root?
find_project_root('20007')
#> Warning: [ENOENT] Failed to search directory 'C:/Users/runner': no such file or directory
#> Error in find_project_root("20007"): Could not find directory matching "Resource Systems Group" in C:/Users/runner.
#> Maybe include "Documents" in root?
find_project_root('Skagit')
#> Warning: [ENOENT] Failed to search directory 'C:/Users/runner': no such file or directory
#> Error in find_project_root("Skagit"): Could not find directory matching "Resource Systems Group" in C:/Users/runner.
#> Maybe include "Documents" in root?
## End(Not run)