Learn R Programming

mrap

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")

Copy Link

Version

Install

install.packages('mrap')

Monthly Downloads

158

Version

1.0.1

License

MIT + file LICENSE

Maintainer

Markus Stocker

Last Published

December 8th, 2025

Functions in mrap (1.0.1)

multilevel_analysis

Create a multilevel_analysis instance
correlation_analysis

Create a correlation_analysis instance
data_analysis

Create a data_analysis instance
class_prediction

Create a class_prediction instance
mrap-package

mrap: Machine-Readable Data Analysis Results with Function Wrappers
descriptive_statistics

Create a descriptive_statistics instance
group_comparison

Create a group_comparison instance
class_discovery

Create a class_discovery instance
factor_analysis

Create a factor_analysis instance
algorithm_evaluation

Create an algorithm_evaluation instance
regression_analysis

Create a regression_analysis instance
to_jsonld

Write an instance in JSON-LD format
stats_aov

Wrap stats::aov function