Skip to contents

This function downloads and sources the SHARK4R required and recommended field definitions directly from the SHARK4R-statistics GitHub repository.

Usage

load_shark4r_fields(verbose = TRUE)

Arguments

verbose

Logical; if TRUE (default), prints progress messages during download and loading.

Value

Invisibly returns a list with two elements:

required_fields

Object containing required SHARK fields.

recommended_fields

Object containing recommended SHARK fields.

Details

The definitions are stored in an R script (fields.R) located in the fields/ folder of the repository. The function sources this file directly from GitHub into the current R session.

The sourced script defines two main objects:

  • required_fields — vector or data frame of required SHARK fields.

  • recommended_fields — vector or data frame of recommended SHARK fields.

The output of this function can be directly supplied to the check_fields function through its field_definitions argument for validating SHARK4R data consistency.

If sourcing fails (e.g., due to a network issue or repository changes), the function throws an error with a descriptive message.

See also

check_fields for validating datasets using the loaded field definitions (as field_definitions). load_shark4r_stats for loading precomputed SHARK4R statistics,

Examples

if (FALSE) { # \dontrun{
# Load SHARK4R field definitions from GitHub
fields <- load_shark4r_fields()

# Access required or recommended fields
fields$required_fields
fields$recommended_fields

# Use the loaded definitions in check_fields()
check_fields(my_data, field_definitions = fields)
} # }