importWaterLevel: importWaterLevel: Imports and compiles views for wetland...

View source: R/importWaterLevel.R

importWaterLevelR Documentation

importWaterLevel: Imports and compiles views for wetland water level data package

Description

This function imports water level-related tables in the wetland RAM backend and combines them into flattened views for the data package. Each view is added to a VIEWS_WL environment in your workspace, or to your global environment based on whether new_env = TRUE or FALSE.

Usage

importWaterLevel(
  export_protected = FALSE,
  type = c("DSN", "file"),
  odbc = "RAM_BE",
  db_path = NA,
  new_env = TRUE,
  export_data = FALSE,
  export_all = FALSE,
  export_path = NA,
  zip = FALSE
)

Arguments

type

Select whether to use the default Data Source Named database (DSN) to import data or a different database. If "DSN" is selected, must specify name in odbc argument.

"DSN"

Default. DSN database. If odbc argument is not specified, will default to "RAM_BE"

"file"

A different database than default DSN

odbc

DSN of the database when using type = DSN. If not specified will default to "RAM_BE", which is the back end of the MS Access RAM database.

db_path

Quoted path of database back end file, including the name of the backend.

new_env

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

export_data

Logical. If TRUE, writes views to disk. If FALSE (Default), views are only stored in specified R environment.

export_all

Logical. If TRUE, exports Accepted, Certified and Raw (winter) records. If FALSE (default), only exports Accepted (pre-2021 QAQCed data) and Certified (post-2020 QAQCed data) records. Accepted and Certified records are those that were collected during the growing season and that were QAQCed following procedures documented in the protocol.

export_path

Quoted path to export views to. If blank, exports to working directory.

zip

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

Value

Assigns RAM views to specified environment

Examples

## Not run: 
# Import tables from database in specific folder:
importWaterLevel(type = 'file', db_path = './Data/NETN_RAM_Backend.mdb')

# Export zip with Accepted or Certified records only
importWaterLevel(export_data = T, zip = T, export_all = F)

## End(Not run)


KateMMiller/wetlandACAD documentation built on Dec. 21, 2024, 1:14 a.m.