GenerateMetaTemplate: Flux metadata template-maker function.

Description Usage Arguments Details Value See Also Examples

Description

This function generates a metadata template for use with 'flux' class objects and writes it to a .csv, with the option to include file and column names taken from a 'flux' object and return that object invisibly. See ImportMeta for details on what the column names mean and how they should be filled.

Usage

1
GenerateMetaTemplate(title, dir = getwd(), flux = NULL, n_treat = 3)

Arguments

title

Title of the metadata file.

dir

Directory to generate the file.

flux

Flux file to start the template.

n_treat

Number of treatment levels in the experiment.

Details

If a 'flux' object is provided, the output file will have the 'FILE' and 'COLUMN_NAME' columns filled in with information taken from the 'raw_data' slot of the flux object, and a flux object will be returned invisibly.

'n_treat“ will specify the number of treatment levels to associate with the flux data. 'Treatment level' here is used in the statistical sense, to refer to e.g. species identity, plot replicate, or site name when SAMPLE is used to refer to individual trees, 'SUB_SAMPLE' to stems on each tree, and 'SUB_SAMPLE_REPLICATE' to probe IDs that are on the same stem on the same tree.

Value

Writes a .csv file to the directory specified by 'dir'. If a 'flux' object is provided, invisibly returns a 'flux' object that can be designated for assignment.

See Also

Other preprocess: AutoDropOutliers, BindRawFlux, ConsoleDropOutliers, DropRainyDays, ImportMeta, ImportRawFlux, MetaDataImport, oldBindRawFlux, oldImportRawFlux

Examples

1
2
3
4
5
6
7
8
9
# Generates a blank template in the current working directory, with
# a treatment level for each of 'species', 'plot', and 'site. Leave
# out the .csv extension.
GenerateMetaTemplate(title = 'sapflux_project_metadata_May2018')
# Use with an existing flux object, does not change object:
GenerateMetaTemplate(title = 'mydata', flux = 'flux_with_my_data')
# Use with existing flux object, adds the metadata to the flux object
# as well as writing the csv:
new_flux <- GenerateMetaTemplate(title = 'mydata', flux = 'old_flux')

bmcnellis/sapflux documentation built on May 12, 2019, 10:27 p.m.