add_g3_attributes: Add gadget3 attributes to an existing data frame

View source: R/add_g3_attributes.R

add_g3_attributesR Documentation

Add gadget3 attributes to an existing data frame

Description

Adds gadget3 attributes and missing columns to a a data frame ready to be passed to gadget3. Useful for importing data manually to gadget without the mfdb step.

Usage

add_g3_attributes(x, params, warn = 1)

Arguments

x

A data frame, tibble or data table.

params

A list of parameters defining the grouping. See details in mfdb_sample_count.

warn

Integer value to set the handling of warning messages. See the warn argument in options for details. In brief, set to negative to ignore warnings, to 1 to print warnings as they occur and to 2 to stop executing and return an error instead of a warning. The last is meant to prevent passing information that may cause unintended behavior in gadget3 models and is recommended.

Value

Returns x with g3 attributes and missing columns as instructed by the params argument.


gadget-framework/gadgetutils documentation built on Nov. 11, 2024, 6:25 p.m.