ffm_db_load: Attempts to load the entire contents of a database into the R...

View source: R/ffm_db_functions.R

ffm_db_loadR Documentation

Attempts to load the entire contents of a database into the R workspace.

Description

Given a path and filename for a database of model results, this function connects to the database and loads the full contents of all tables into a list of data frames. An error is returned if the database cannot be opened.

Usage

ffm_db_load(db.path)

Arguments

db.path

The path and filename for the database.

Value

A named list of data frames corresponding to database tables.

Examples

## Not run: 
# Load the contents of a database and display the start
# of the FlameSummaries table
tbls <- ffm_db_load("c:/michael/somewhere/my_results.db")
head( tbls$FlameSummaries)

## End(Not run)

SPECIFY INPUTS AND RUN THE MODEL
record <- 1
data(site)
data(structure)
data(flora)
data(traits)
base.params <- paramBuilder(site, structure, flora, traits, record) 
ffm_run(base.params, db.path = "out.db", db.recreate = TRUE)

LOAD RESULTS
res<-ffm_db_load("out.db")


pzylstra/frame_r documentation built on Nov. 12, 2023, 1:55 a.m.