MyNixOS website logo
Description

Generic Data Tagging and Validation Tool.

Provides tools to help tag and validate data according to user-specified rules. The 'safeframe' class adds variable level attributes to 'data.frame' columns. Once tagged, these variables can be seamlessly used in downstream analyses, making data pipelines clearer, more robust, and more reliable.

safeframe: Generic Data Tagging and Validating Logo for safeframe

License:MIT R-CMD-check Codecov testcoverage lifecycle-concept

safeframe provides functions to tag and validate data of any kind. safeframe is an abstraction of linelist, which originally applied these principles to epidemiological linelist data. The original proposal for this package can be found on the Discussion board.

Installation

You can install safeframe from CRAN (release) or GitHub (development):

# CRAN
install.packages('safeframe')

# Development
# install.packages("pak")
pak::pak("epiverse-trace/safeframe")

Getting started

library(safeframe)

# Create a safeframe object
x <- make_safeframe(cars, mph = "speed", distance = "dist")

# Validate the tagged data are of a specific type
validate_safeframe(x,
  mph = 'numeric',        # speed should be numeric
  # type() is a helper function of related classes
  distance = type('numeric')    # dist should be numeric, integer
)

Development

Lifecycle

This package is currently maturing, as defined by the RECON software lifecycle:

Package is functional, documented and tested. Can be used in production with the understanding that the interface may still undergo minor changes. Typically semantic version < 1.0.0.

Contributions

Contributions are welcome via pull requests. Anything bigger than a typo fix or a small documentation update should be discussed in an issue first. If you want to report a bug or suggest an enhancement, please open an issue. 😊 See also the general Epiverse-TRACE contribution document.

Common issues

To make it easier for us to evaluate your contribution, please run the following commands before submitting a pull request to ensure your code is consistent with the rest of the package:

styler::style_pkg()
devtools::document()
spelling::update_wordlist(pkg = ".", vignettes = TRUE)

lintr::lint_package()

devtools::test()
devtools::check()

This will reduce the time it takes for us to review your contribution. Thank you! 😊

Related projects

This project is related to other existing projects in R or other languages, but also differs from them in the following aspects:

  • labelled: A package for tagging data in R, but it is more focused on tagging variables than validating them.
  • linelist: A package for managing and validating linelist data - the original inspiration for safeframe.
  • struct: A package that “provides ways to modify objects more strictly, guaranteeing that we keep the type of the modified element.”

Code of Conduct

Please note that the safeframe project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows