Learn R Programming

dataclass

Easily Create Structured Lists or Data Frames with Input Validation

Easily define templates for lists and data frames that validate each element. Specify the expected type (i.e., character, numeric, etc), expected length, minimum and maximum values, allowable values, and more for each element in your data. Decide whether violations of these expectations should throw an error or a warning. This package is useful for validating data within R processes which pull from dynamic data sources such as databases and web APIs to provide an extra layer of validation around input and output data.

Typing in R

The package is also experimenting with typing (i.e., enforcing variables to be a specific type). This can be enforced using dataclass::enforce_types() in your function header. Learn more about this using ?dataclass::enforce_types.

Copy Link

Version

Install

install.packages('dataclass')

Monthly Downloads

52

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Chris Walker

Last Published

September 24th, 2024

Functions in dataclass (1.0.0)

num_vec

Validator: Check if element is a number
dataclass-package

dataclass: Easily Create Structured Lists or Data Frames with Input Validation
dte_vec

Validator: Check if element is a date
any_obj

Validator: Allow any object
atm_vec

Validator: Check if element is atomic
dataclass

Construct a dataclass in R
chr_vec

Validator: Check if element is a character
df_like

Validator: Check if element is a data like object
data_validator

Convert a dataclass to a data frame validator
enforce_types

lgl_vec

Validator: Check if element is a logical