Skip to content

Commit ae2aa74

Browse files
committed
additional testing for fastLm
1 parent 88a3732 commit ae2aa74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inst/tinytest/test_fastLm.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/r -t
22
#
3-
# Copyright (C) 2011 - 2019 Douglas Bates, Dirk Eddelbuettel and Romain Francois
3+
# Copyright (C) 2011 - 2021 Douglas Bates, Dirk Eddelbuettel and Romain Francois
44
#
55
# This file is part of RcppEigen
66
#
@@ -27,6 +27,7 @@ flm2 <- fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 2L)
2727
flm3 <- fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 3L)
2828
flm4 <- fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 4L)
2929
flm5 <- fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 5L)
30+
flm6 <- fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 6L)
3031

3132
fit <- lm(log(Volume) ~ log(Girth), data=trees)
3233
fitCoef <- unname(coef(fit))
@@ -44,6 +45,11 @@ expect_equal(flm4$coefficients , fitCoef, info="fastLm0.coef")
4445
expect_equal(flm4$se , fitStdErr, info="fastLm0.stderr")
4546
expect_equal(flm5$coefficients , fitCoef, info="fastLm0.coef")
4647
expect_equal(flm5$se , fitStdErr, info="fastLm0.stderr")
48+
expect_equal(flm6$coefficients , fitCoef, info="fastLm0.coef")
49+
expect_equal(flm6$se , fitStdErr, info="fastLm0.stderr")
50+
51+
## check unsupported type
52+
expect_error(fastLmPure(cbind(1, log(trees$Girth)), log(trees$Volume), 7L))
4753

4854

4955
#test.fastLm.formula <- function() {

0 commit comments

Comments
 (0)