R Under development (unstable) (2023-08-05 r84874 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(efdm) > library(testthat) > > statespace <- expand.grid(sp=factor(c("spruce", "pine")), vol=1:4) > actprob <- statespace > actprob$test <- actprob$sp == "spruce" > actprob$test2 <- 1-actprob$test > > act1 <- define_activity("test", "vol") > transprobs(act1) <- data.frame(sp=factor("spruce"), vol0=1:4, vol1=4, prob=1) > > act2 <- define_activity("test2", "vol") > transprobs(act2) <- data.frame(sp=factor("pine"), vol0=1:4, vol1=1, prob=1) > > # Factors are matched on their character representation. > # Try to test that anyway > state0 <- data.frame(sp=factor(c("spruce", "pine")), vol=2, area=1) > state1 <- runEFDM(state0, actprob, list(act1, act2), 2) > state0 <- data.frame(sp=factor(c("pine", "spruce")), vol=2, area=1) > state2 <- runEFDM(state0, actprob, list(act1, act2), 2) > expect_equal(state1, state2) > > proc.time() user system elapsed 0.81 0.12 0.90