writeFIA: Write FIA tables to local directory

Description Usage Arguments Details Author(s) See Also Examples

View source: R/readWriteGet.R

Description

Write FIA.Database object to local directory as a series of .csv files representing each table. Most useful for writing merged states and temporal/spatial subsets of the database. Once written as .csv, files can be reloaded into R with readFIA.

Usage

1
writeFIA(db, dir, byState = FALSE, nCores = 1, ...)

Arguments

db

FIA.Database object produced from readFIA or getFIA.

dir

directory where FIA Datatables will be stored.

nCores

numeric; number of cores to use for parallel implementation. Check available cores using detectCores. Default = 1, serial processing.

byState

logical; should tables be written out by state? Must be TRUE if planning to load data as an out-of-memory database in the future (see readFIA).

...

other arguments to pass to fwrite.

Details

Easy, efficient parallelization is implemented with the parallel package. Users must only specify the nCores argument with a value greater than 1 in order to implement parallel processing on their machines. Parallel implementation is achieved using a snow type cluster on any Windows OS, and with multicore forking on any Unix OS (Linux, Mac). Implementing parallel processing may substantially decrease decrease free memory during processing, particularly on Windows OS. Thus, users should be cautious when running in parallel, and consider implementing serial processing for this task if computational resources are limited (nCores = 1).

Author(s)

Hunter Stanke and Andrew Finley

See Also

readFIA, getFIA

Examples

1
2
3
4
## Write the 'fiaRI' object to a temporary directory
## Replace temp_dir with the path to your directory (where data will be saved)
temp_dir = tempdir()
writeFIA(fiaRI, dir = temp_dir)

rFIA documentation built on Dec. 16, 2021, 1:07 a.m.