tar_recipe: Recipe Target

Description Usage Arguments Value Examples

View source: R/tar_recipe.R

Description

Recipe Target

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tar_recipe(name, x, ...)

## Default S3 method:
tar_recipe(name, x, ...)

## S3 method for class 'data.frame'
tar_recipe(name, x, formula = NULL, ..., tar_args = list())

## S3 method for class 'formula'
tar_recipe(name, formula, data, ..., tar_args = list())

## S3 method for class 'matrix'
tar_recipe(name, x, ..., tar_args = list())

Arguments

name

Name of target

x

A data frame or tibble of the template data set (see below).

...

Additional functions that the recipe is passed to, i.e. recipe step functions.

formula

A model formula. No in-line functions should be used here (e.g. log(x), x:y, etc.) and minus signs are not allowed. These types of transformations should be enacted using step functions in this package. Dots are allowed as are simple multivariate outcome terms (i.e. no need for cbind; see Examples). A model formula may not be the best choice for high-dimensional data with many columns, because of problems with memory.

tar_args

Arguments passed to tar_target.

data

A data frame or tibble of the template data set (see below).

Value

A tar_target object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
    # Basic recipe
    tar_recipe(
        make_recipe,
        x = mtcars,
        formula = mpg ~ .,
        step_dummy(gear, carb),
        tar_args = list(format = "qs")
    )

## End(Not run)

program--/modeltargets documentation built on Dec. 22, 2021, 9:54 a.m.