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

View source: R/importCSV.R

importCSVR Documentation

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

Description

This function imports all views in the ANALYSIS schema of the MIDN_Forest backend that have been previously exported as .csvs or a zip file using the exportCSV() function. Each view is added to a VIEWS_MIDN_NCBN 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_MIDN_NCBN 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

MIDN 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(2306436)
importCSV("./data/2306436")

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

# Import zipped csvs into VIEWS_MIDN_NCBN environment
path <- "C:/Forest_Health/exports/MIDN"
importCSV(path = path, zip_name = "MIDN_Forest_20210409.zip")

## End(Not run)

KateMMiller/forestMIDN documentation built on Nov. 10, 2024, 11:54 p.m.