Skip to contents

An 'annex config object' is a simple data.frame which can be created using Rs standard features. The function is checking if the content of the object matches the requirements of being an annex config object. This check will be performed in link{annex()} automatically, but can also be done by the user manually.

Usage

annex_check_config(x)

Arguments

x

object of class data.frame to be checked.

Value

Invisibly returns a (possibly modified) version of x

containing only the required columns in a specific order.

Details

The function checks if the config object is set up properly and contains the required information for preparing the annex data.

Throws errors if:

  • the input is not a data.frame

  • variables are missing ('column', 'variable', 'unit', 'study', 'home', 'room')

  • configuration for variable = "datetime" is missing

  • there is no definition for variables (datetime only)

  • the config contains missing values in the required variables

  • column name for variable = "datetime" is missing

  • the variable 'column' is not unique

  • there are duplicated entries for the combination of variable/study/home/room (must be unique)

  • variables study, home or room contain contain non-allowed characters. Must only contain letters (lowercase or uppercase), numbers, and underscores. Must start with a letter.

Author

Reto Stauffer