exportCSV: exportCSV: Export SQL views to .csv

View source: R/exportCSV.R

exportCSVR Documentation

exportCSV: Export SQL views to .csv

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

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

## Not run: 
# 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")

## End(Not run)


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