inst/doc/datastepping.R

## ---- message=FALSE------------------------------------------------------
library(datastepr)

## ------------------------------------------------------------------------
step = dataStepClass$new()

## ------------------------------------------------------------------------
?dataStepClass()

## ------------------------------------------------------------------------
xFrame = data.frame(x = 0:9)

## ------------------------------------------------------------------------
y_initial = data.frame(y = 1)

## ------------------------------------------------------------------------
stairs = function(...) {
  step$begin(environment())

  if (step$i == 1) step$set(y_initial)

  if (step$i > 1) lagx = x

  step$set(xFrame)
  
  if (step$i > 1) y = y + dydx*(x - lagx)
 
  dydx = x*y
  
  step$output()
  
  step$end(stairs)
}

stairs()

## ------------------------------------------------------------------------
knitr::kable(step$results)

Try the datastepr package in your browser

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

datastepr documentation built on May 2, 2019, 3:34 a.m.