Skip to content

Commit a657b24

Browse files
committed
update rlm test
1 parent 791def1 commit a657b24

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/testthat/test-rlm.R

+11-8
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ test_that("fast_rlm", {
1313
system.time(r1 <- MASS::rlm(x, y))
1414
system.time(r2 <- fast_rlm(x, y))
1515
# r2$coefficients is unnamed
16-
expect_equal(r1$coefficients, r2$coefficients, check.attributes = FALSE)
17-
18-
#del unrelevant parameters before comparison
19-
r1 = r1[names(r2)]
20-
expect_equivalent(r1, r2)
21-
# library(ggplot2)
22-
# ggplot(df, aes(x,y)) +geom_point() + geom_abline(slope = r1$coefficients)
23-
# plot(y~x, data = data.frame(x, y)) + abline(r1)
16+
expect_equivalent(r1$coefficients, r2$coefficients)
17+
sel = c("coefficients"
18+
, "residuals"
19+
, "fitted.values"
20+
, "weights"
21+
, "rank"
22+
, "converged"
23+
, "wresid"
24+
, "w" ,"x", "s"
25+
)
26+
expect_equivalent(r1[sel], r2[sel])
2427

2528

2629
})

0 commit comments

Comments
 (0)