inst/unitTests/runit.TTR.DVI.R

#
# RUnit tests TTR DVI
#

# Create input data
data(ttrc)
rownames(ttrc) <- ttrc$Date
ttrc$Date <- NULL

#################################################

test.correct_column_names <- function() {
  dat <- setNames(ttrc$Close, rownames(ttrc))
  dvi <- DVI(dat)

  checkEquals(colnames(dvi), c("dvi.mag", "dvi.str", "dvi"))
}

Try the TTR package in your browser

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

TTR documentation built on May 29, 2024, 3:54 a.m.