Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stackByTable

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)

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

Utilities for Working with NEON Data

v2.0.1
AGPL-3
Authors
Claire Lunch [aut, cre, ctb], Christine Laney [aut, ctb], Nathan Mietkiewicz [aut, ctb], Eric Sokol [aut, ctb], Kaelin Cawley [aut, ctb], NEON (National Ecological Observatory Network) [aut]
Initial release
2021-03-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.