writeFIA {rFIA} | R Documentation |
Write FIA tables to local directory
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
writeFIA(db, dir, byState = FALSE, nCores = 1, ...)
Arguments
db |
|
dir |
directory where FIA Datatables will be stored. |
nCores |
numeric; number of cores to use for parallel implementation. Check available cores using |
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 |
... |
other arguments to pass to |
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
).
Value
No return value, called to export FIA.Database
object to a local directory.
Author(s)
Hunter Stanke and Andrew Finley
See Also
Examples
# 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)