LoadDesertSprings: Load raw data into package environment

View source: R/utils.R

LoadDesertSpringsR Documentation

Load raw data into package environment

Description

Run this function before you do anything else.

Usage

LoadDesertSprings(
  data_path = c(main_db =
    "https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/MOJN_DS_SpringVisit/FeatureServer",
    lookup_db =
    "https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/MOJN_Lookup_Database/FeatureServer",
    sites_db =
    "https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/MOJN_DS_Sites_Master/FeatureServer",
    calibration_db =
    "https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/MOJN_Calibration_Database/FeatureServer"),
  use_default_sql = FALSE,
  sql_drv = odbc::odbc(),
  agol_username = "mojn_hydro",
  agol_password =
    rstudioapi::askForPassword(paste("Please enter the password for AGOL account",
    agol_username)),
  ...
)

Arguments

data_path

A path or URL to the data. Accepted inputs: * 4 URLs to the AGOL feature services containing the data (main_db, lookup_db, sites_db, and calibration_db) * a folder containing the data in csv format * a .zip file containing the data in csv format * '"database"' (connect to the deprecated SQL server database)

use_default_sql

Use default SQL database? Ignored if 'data_path != "database"'.

sql_drv

Driver to use to connect to database. Ignored if 'data_path != "database"'.

...

Additional arguments to OpenDatabaseConnection (ignored if 'data_path != "database"')

Value

Invisibly return a list containing all raw data

Examples

## Not run: 
LoadDesertSprings()  # Read from AGOL
LoadDesertSprings("database")  # Read from SQL db
LoadDesertSprings("path/to/csv/folder")  # Read from folder of CSV's
LoadDesertSprings("path/to/zipped/csvs.zip")  # Read from zip file of CSV's

## End(Not run)


nationalparkservice/mojn-ds-rpackage documentation built on Oct. 5, 2023, 6:21 p.m.