tests/calc.true.weight.test.R

###################################################
##
##
## Tests for function "calc.true.weight"
##
##################################################

library(backtest)

load("calc.true.weight.test.RData")

## save(calc.data, calc.truth, file = "calc.true.weight.RData")


result <- backtest:::calc.true.weight(calc.data, "date", "id", 2)
true.weight.result <- result$weight


stopifnot(
          isTRUE(all.equal(true.weight.result, calc.truth))
          )
             

Try the backtest package in your browser

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

backtest documentation built on May 2, 2019, 10:58 a.m.