MyNixOS website logo
Description

Machine-Readable Data Analysis Results with Function Wrappers.

You can use the set of wrappers for analytical schemata to reduce the effort in writing machine-readable data. The set of all-in-one wrappers will cover widely used functions from data analysis packages.

mrap

coverage CRANstatus

100% AI-free: we did not use any AI technologies in developing this package.

The goal of mrap is to provide wrapper functions to reduce the user’s effort in writing machine-readable data with the dtreg package. Analytical wrappers facilitate writing the data with the schemata used by TIB Knowledge Loom. All-in-one wrappers (currently, mrap::stats_aov) will cover functions from stats and other well-known packages.

Installation

The easiest way is to install mrap from CRAN:

install.packages("mrap")

You can install the development version of mrap with:

# install.packages("devtools")
library(devtools)
devtools::install_gitlab("TIBHannover/lki/knowledge-loom/mrap-r", build_vignettes = TRUE)

Example

For instance, you conducted ANOVA on Iris data.

library(mrap)
attach(iris)
my_anova <- stats::aov(Petal.Length ~ Species, data = iris)
my_results <- summary(my_anova)[[1]]

On the help page, you see that the group_comparison schema should be used. Instead of writing the data manually with dtreg, use the group_comparison function from mrap. Arguments code_string, input_data, and test_results should be provided.

inst_gc <-
  mrap::group_comparison("stats::aov(Petal.Length ~ Species, data = iris)",
                         iris,
                         my_results)
my_json <- mrap::to_jsonld(inst_da)

Alternatively, you can use the all-in-one wrapper for stats::aov function. It returns the ANOVA results similar to the original function and a group_comparison instance:

aov <- mrap::stats_aov(Petal.Length ~ Species, data = iris)
results <- aov$anova
inst_gc <- aov$dtreg_object

The resulting group_comparison instance can be modified and included into the data_analysis instance. The final instance can be written as JSON-LD:

inst_gc$label <- "ANOVA for Iris petal length"
inst_da <- mrap::data_analysis(inst_gc)
my_json <- mrap::to_jsonld(inst_da)

For more information, please see the help page and the mrap vignette. To access the vignette, you can run:

vignette("mrap", package="mrap")
Metadata

Version

1.0.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • 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-linux
  • 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-uefi
  • x86_64-windows