extract_data: Extract Database Data

View source: R/download_data.R

extract_dataR Documentation

Extract Database Data

Description

Extracts all tables from an input database into data.frames inside an isolated environment. If the env variable is set to .GlobalEnv, the objects will be assigned to variables in the users global environment. This might be convienent for some, but has the dangerous side effect of overwritting any existing objects with the same names in the global environment.

Usage

extract_data(db_file, env = new.env())

Arguments

db_file

character, the path to the database file to extract data from.

env

an environment to store the tables from the database

Value

environment, with one data.frame per table in the input database

Author(s)

Matt Espe

Examples

## Not run: 
# All data
detection_db = download_data(my_session)

# One species
detection_db = dowloand(data(my_session, speciesID = 1)

# defaults to putting tables in an environment
detection_data = extract_data(detection_db)

# Access data via $
names(detection_data)
detection_data$Registrations
as.list(detection_data)

## End(Not run)

fishsciences/telemetry documentation built on May 31, 2024, 10:13 a.m.