importCSV: importCSV: Import NETN forest data that are formatted as .csv...

View source: R/importCSV.R

importCSVR Documentation

importCSV: Import NETN forest data that are formatted as .csv files.

Description

This function imports all views in the ANALYSIS schema of the NETN_Forest backend that have been previously exported as .csvs or a zip file using the exportCSV() function. Each view is added to a VIEWS_NETN environment in your workspace, or to your global environment based on whether new_env = TRUE or FALSE.

Usage

importCSV(path = NA, new_env = TRUE, zip_name = NA)

Arguments

path

Quoted path of folder containing tables.

new_env

Logical. Specifies which environment to store views in. If TRUE(Default), stores views in VIEWS_NETN environment. If FALSE, stores views in global environment

zip_name

Quoted string ending in .zip. If specified, function looks for the specified file name and imports .csvs from the zip file. If not specified, function looks for and imports individual csvs. Note that this takes slightly longer than loading individual .csvs, due to the unzipping process.

Value

NETN database views in specified environment

Examples

## Not run: 

#' # Import data package from IRMA and import into R
devtools::install_github('nationalparkservice/NPSutils') # takes awhile- lots of dependencies
NPSutils::get_data_package(2306029)
importCSV("./data/2306029")

# Import individual csvs into global environment
importCSV(path = "C:/Forest_Health/exports/NETN", new_env = FALSE)

# Import zipped csvs into VIEWS_NETN environment
path <- "C:/Forest_Health/exports/NETN"
importCSV(path = path, zip_name = "NETN_Forest_20210406.zip")

## End(Not run)


KateMMiller/forestNETN documentation built on Nov. 11, 2024, 6:07 a.m.