@@ -28,8 +28,6 @@ check_reliability <- function(x, ...) {
28
28
}
29
29
30
30
31
-
32
-
33
31
# ' @export
34
32
check_reliability.default <- function (x , ... ) {
35
33
check_reliability(modelbased :: estimate_grouplevel(x , ... ), ... )
@@ -45,24 +43,24 @@ check_reliability.estimate_grouplevel <- function(x, ...) {
45
43
if (length(unique(x $ Level )) < = 3 ) {
46
44
insight :: format_alert(paste0(
47
45
" The number of random levels (N = " ,
48
- length(unique( x $ Level ) ),
46
+ insight :: n_unique( x $ Level ),
49
47
" ) might be too low to reliably estimate the variability."
50
48
))
51
49
}
52
50
53
51
if (length(dispname ) == 0 ) {
54
52
insight :: format_error(paste0(
55
53
" This function requires an index of variability of each random " ,
56
- " effect (e.g., SE) but none was found. Try running check_reliability() on the" ,
57
- " output of modelbased::estimate_grouplevel(model), and make sure the latter " ,
54
+ " effect (e.g., SE) but none was found. Try running ` check_reliability()` on the" ,
55
+ " output of ` modelbased::estimate_grouplevel(model)` , and make sure the latter " ,
58
56
" returns a table with an index of dispersion."
59
57
))
60
58
}
61
59
62
60
if (length(dispname ) > 1 ) {
63
61
insight :: format_alert(paste0(
64
62
" Multiple indices of variability were found (" ,
65
- paste (dispname , collapse = " , " ),
63
+ toString (dispname ),
66
64
" ). Using the first one."
67
65
))
68
66
dispname <- dispname [1 ]
@@ -91,7 +89,7 @@ check_reliability.estimate_grouplevel <- function(x, ...) {
91
89
}
92
90
93
91
# Clean-up output
94
- if (length(unique( reliability $ Component ) ) == 1 && unique(reliability $ Component ) == " TEMP" ) {
92
+ if (insight :: n_unique( reliability $ Component ) == 1 && unique(reliability $ Component ) == " TEMP" ) {
95
93
reliability $ Component <- NULL
96
94
}
97
95
0 commit comments