importData: importData: Import tables directly from MIDN forest database

Description Usage Arguments Value Examples

View source: R/importData.R

Description

This function imports database tables from a named ODBC datasource from MIDN forest backend databases. Each table is assigned to the global environment with names that functions in this package depend on. You must use the 32-bit version of R to work.

Usage

1
2
3
4
5
6
7
importData(
  type = c("DSN", "file"),
  odbc = "MIDNFVM",
  path = NA,
  import_tables = c("all", "single"),
  table_name = NA
)

Arguments

type

Select whether to use the default DSN to import data or a different database

"DSN"

Default. DSN database. If not specified, will use "NETNFVM" .

"file"

A different database than default DSN

path

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

import_tables

Specify whether to import all tables or individual tables

"all"

Default. Imports all relevant tables from the backend database.

"single"

Imports an individual table or tables from the backend database. If single is specified, you must then specify the exact table name in quotes from the backend database. The table will be given the same object name as if all tables were imported so that package functions are still useable.

table_name

Specify a quoted list of one or more table names

Value

Assigns database tables to global environment

Examples

1
2
3
4
5
6
7
8
# Import database in specific folder:
importData(type='file', path='./Data/MIDN_Forest_Backend.mdb')

# Import ODBC named database
importData(type='DSN', odbc="MIDNFVM")

# Import individual tables
importData(import_tables='single',table_name=c('tlu_Plants','tbl_Quadrat_Species_Data'))

KateMMiller/forestMIDNarch documentation built on April 9, 2021, 3:50 p.m.