aurelius Basic Usage

Motivation

The purpose of this document is to demonstrate some of the functionalty provided by the aurelius package.

NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  purl = NOT_CRAN,
  eval = NOT_CRAN
)
## this is nice during development = on github
## this is not so nice for preparing vignettes for CRAN
#options(knitr.table.format = 'markdown')

A Simple Example

First, we load the aurelius

library(aurelius)

Second, let's build a simple linear regression model and convert to PFA.

# build a model
lm_model <- lm(mpg ~ hp, data = mtcars)

# convert the lm object to a list-of-lists PFA representation
lm_model_as_pfa <- pfa(lm_model)

The model can be saved as PFA JSON and used in other systems.

# save as plain-text JSON
write_pfa(lm_model_as_pfa, file = "my-model.pfa")

Just as models can be written as a PFA file, they can be read.

my_model <- read_pfa("my-model.pfa")


Try the aurelius package in your browser

Any scripts or data that you put into this service are public.

aurelius documentation built on May 2, 2019, 3:43 a.m.