tests/testthat/_problems/test-testtrajectory-46.R

# Extracted from test-testtrajectory.R:46

# setup ------------------------------------------------------------------------
library(testthat)
test_env <- simulate_test_env(package = "TreeDimensionTest", path = "..")
attach(test_env, warn.conflicts = FALSE)

# prequel ----------------------------------------------------------------------
x = rnorm(100)
y = x+1
linear = cbind(x,y)
x = c(0,0,0,1,-1)
y = c(0,1,-1,0,0)
star = cbind(x,y)
x = seq(from=0, to = 10, by=1)
y = rep(5,length(x))
mat = cbind(x,y)
mat = rbind(mat, cbind(rep(5,length(x)),x))
mat = mat[-6,]

# test -------------------------------------------------------------------------
expect_equal(compute.stats(mat, MST="boruvka", dim.reduction = "none")$tdt_measure, 2)

Try the TreeDimensionTest package in your browser

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

TreeDimensionTest documentation built on July 19, 2026, 1:07 a.m.