Skip to content

Commit 636b9d3

Browse files
authored
get_varcov() works when vcov is of class "dpoMatrix". (#1192)
* `get_varcov()` works when `vcov` is of class `"dpoMatrix"`. * fix
1 parent 507944a commit 636b9d3

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: insight
33
Title: Easy Access to Model Information for Various Model Objects
4-
Version: 1.5.0.8
4+
Version: 1.5.0.9
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
* `has_intercept()` now correctly detects whether models from packages *fixest*
2424
and *lfe* have intercepts or not.
2525

26+
* The `vcov` argument in `get_varcov()` was ignored when `vcov` was of class
27+
`"dpoMatrix"` and did not return `TRUE` to `is.matrix()`.
28+
2629
# insight 1.5.0
2730

2831
## Changes

R/get_varcov_sandwich.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
) {
1010
dots <- list(...)
1111

12+
# make sure we have a "matrix" class
13+
if (inherits(vcov_fun, "Matrix") || inherits(vcov_fun, "dpoMatrix")) {
14+
check_if_installed("Matrix")
15+
vcov_fun <- as.matrix(vcov_fun)
16+
}
17+
1218
if (is.null(vcov_args)) {
1319
vcov_args <- list()
1420
}

0 commit comments

Comments
 (0)