retrieve_onedrive: retrieve .csv and excel (xls/xlsx) files from...

View source: R/retrieve_onedrive.R

retrieve_onedriveR Documentation

retrieve .csv and excel (xls/xlsx) files from OneDrive/Sharepoint site

Description

retrieve .csv and excel (xls/xlsx) files from OneDrive/Sharepoint site

Usage

retrieve_onedrive(item_path, sheet = NULL, spn = 1, rm_file = TRUE)

Arguments

item_path

path to desired OneDrive sharepoint file. Treat the base directory as root.

sheet

String of sheet to extract (if excel file). Defaults to NULL

spn

Share point number. Can determine by running Microsoft365R::list_sharepoint_sites() and determining which site number is appropriate. Defaults to 1. If you have more than one sharepoint site on your account you may need to adjust this!

rm_file

the function needs to download a copy of the file into your current directory. Leaving this set to TRUE (default) will remove the downloaded file.

Value

Extracted OneDrive file

Author(s)

Nate Hall

Examples


## Not run: 
     master <- retrieve_onedrive("Studies/NeuroMAP/Participant Management/Master Spreadsheets/NeuroMAP Master UNC.xlsx") # returns all sheets in a named list
     tracker <- retrieve_onedrive("Studies/NeuroMAP/Participant Management/Master Spreadsheets/NeuroMAP Master UNC.xlsx", sheet = "Tracker") # extracts only the Tracker sheet

## End(Not run)


PennStateDEPENdLab/dependlab documentation built on June 15, 2024, 8:49 a.m.