exportCSV: exportCSV: Export SQL views to .csv

Description Usage Arguments Value Examples

View source: R/exportCSV.R

Description

This function exports NETN_Forest database views either to individual .csv files, or as a zip file with the database name (NETN_Forest), and the date it was zipped. The exported .csv or .zip files can then be imported via importCSV(). This function is primarily for internal use to create flat files that users can import to run functions in this package without having a connection to the database server. This is particularly useful for external users who don't have access to NPS servers.

Usage

1
exportCSV(path = NA, zip = FALSE)

Arguments

path

Quoted path to save files to. If not specified, will save to working directory.

zip

Logical. If TRUE, exports a zip file. If FALSE (Default), exports individual csvs.

Value

NETN database views exported to specified path

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# RUN FIRST
library(forestNETN)
importData()

# Export csvs to working directory
exportCSV()

# Export a zip to the path specified
exportCSV(path = "C:/Forest_Health/exports/NETN", zip = TRUE)

# Export views as .csvs to specified path
exportCSV(path = "C:/Forest_Health/exports/NETN")

KateMMiller/forestNETN documentation built on May 30, 2021, 6:39 a.m.