mutatedMod.frame: A version of dplyr::mutate

View source: R/dModFrameClass.R

mutatedMod.frameR Documentation

A version of dplyr::mutate

Description

This is basically dplyr::mutate with two differences 1. It groups the tibble rowwise before mutating 2. It allows to store the calls. This is intended for use when your objects are not standard transformations, such as prd = g*x*p but more complicated and you want to keep a record of what you did.

If the result of your ... expressions is not atomic, make sure to wrap your expression in list()

Usage

mutatedMod.frame(dMod.frame, ..., keepCalls = F)

Arguments

dMod.frame

A dMod.frame

...

Expressions going to mutate()

keepCalls

Should the dots ... be recorded?

Examples

## Not run: 
mytbl <- tibble(a = 1:2, b = letters[1:2]) %>%
mutatedMod.frame(e = paste0(a,b), keepCalls = T) %>%
mutatedMod.frame(f = paste0(e, "=", a, "*", b), keepCalls = T) %>%
mutatedMod.frame(e = paste0(a,"*", b), keepCalls = T)

mytbl$.calls

## End(Not run)

dkaschek/dMod documentation built on April 23, 2024, 5:18 p.m.