Skip to contents

Pulls the site or drive (if given) or returns the stored default. Useful if you need to use methods that aren't currently wrapped by tntpr

Usage

sp_site(site = NULL)

sp_drive(drive = NULL, site = NULL)

Arguments

site

Site identifier. Can be the site name, id, URL, or an ms_site object. If no site identifier is provided, uses the stored default site if it exists.

drive

Drive identifier. Can be the drive name, id, or an ms_drive object. If site is provided but drive is not, uses the first drive of the provided site. If neither is provided, uses the stored default drive if it exists.

Value

A Microsoft365R site object or drive object

Examples

if (FALSE) { # interactive()

# Get current default site or drive
x <- sp_site()
y <- sp_drive()

# Get specified site or drive
x <- sp_site("Data Analytics")
y <- sp_drive("Documents") # Uses stored default site
y <- sp_drive("Documents", site = "Data Analytics") # Use provided site

# Use additional methods in the site/drive objects
x$get_lists()
y$get_item_properties("Analysis Tools.docx")
}