stackByTable: Join data files in a zipped NEON data package by table type

View source: R/stackByTable.R

stackByTableR Documentation

Join data files in a zipped NEON data package by table type

Description

Given a zipped data file, do a full join of all data files, grouped by table type. This should result in a small number of large files.

Usage

stackByTable(
  filepath,
  savepath = NA,
  folder = FALSE,
  saveUnzippedFiles = FALSE,
  dpID = NA,
  package = NA,
  nCores = 1
)

Arguments

filepath

The location of the zip file

savepath

The location to save the output files to

folder

T or F: does the filepath point to a parent, unzipped folder, or a zip file? If F, assumes the filepath points to a zip file. Defaults to F. No longer needed; included for back compatibility.

saveUnzippedFiles

T or F: should the unzipped monthly data folders be retained?

dpID

Data product ID of product to stack. Ignored and determined from data unless input is a vector of files, generally via stackFromStore().

package

Data download package, either basic or expanded. Ignored and determined from data unless input is a vector of files, generally via stackFromStore().

nCores

The number of cores to parallelize the stacking procedure. To automatically use the maximum number of cores on your machine we suggest setting nCores=parallel::detectCores(). By default it is set to a single core.

Value

All files are unzipped and one file for each table type is created and written. If savepath="envt" is specified, output is a named list of tables; otherwise, function output is null and files are saved to the location specified.

Author(s)

Christine Laney claney@battelleecology.org Claire Lunch clunch@battelleecology.org

References

License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007

Examples

## Not run: 
# To unzip and merge files downloaded from the NEON Data Portal
stackByTable("~/NEON_par.zip")

# To unzip and merge files downloaded using zipsByProduct()
stackByTable("~/filesToStack00024")

## End(Not run)

neonUtilities documentation built on April 15, 2022, 1:06 a.m.