Skip to content

Commit 2fb2ce7

Browse files
committed
lintr, add back docs
1 parent c726845 commit 2fb2ce7

File tree

3 files changed

+63
-34
lines changed

3 files changed

+63
-34
lines changed

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: 0.19.8.2
4+
Version: 0.19.8.3
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

R/format_ci.R

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ format_ci <- function(CI_low, ...) {
3939
}
4040

4141

42-
42+
#' @rdname format_ci
4343
#' @export
4444
format_ci.numeric <- function(CI_low,
45-
CI_high,
46-
ci = 0.95,
47-
digits = 2,
48-
brackets = TRUE,
49-
width = NULL,
50-
width_low = width,
51-
width_high = width,
52-
missing = "",
53-
zap_small = FALSE,
54-
...) {
45+
CI_high,
46+
ci = 0.95,
47+
digits = 2,
48+
brackets = TRUE,
49+
width = NULL,
50+
width_low = width,
51+
width_high = width,
52+
missing = "",
53+
zap_small = FALSE,
54+
...) {
5555
# check proper defaults
5656
if (isTRUE(brackets)) {
5757
ci_brackets <- c("[", "]")
@@ -115,7 +115,22 @@ format_ci.numeric <- function(CI_low,
115115

116116
if (is.na(missing)) missing <- NA_character_
117117

118-
if (!is.null(ci)) {
118+
if (is.null(ci)) {
119+
ifelse(
120+
is.na(CI_low) & is.na(CI_high),
121+
missing,
122+
.format_ci(
123+
CI_low,
124+
CI_high,
125+
digits = digits,
126+
ci_brackets = ci_brackets,
127+
width_low = width_low,
128+
width_high = width_high,
129+
missing = missing,
130+
zap_small = zap_small
131+
)
132+
)
133+
} else {
119134
ifelse(is.na(CI_low) & is.na(CI_high),
120135
missing,
121136
paste0(
@@ -133,21 +148,6 @@ format_ci.numeric <- function(CI_low,
133148
)
134149
)
135150
)
136-
} else {
137-
ifelse(
138-
is.na(CI_low) & is.na(CI_high),
139-
missing,
140-
.format_ci(
141-
CI_low,
142-
CI_high,
143-
digits = digits,
144-
ci_brackets = ci_brackets,
145-
width_low = width_low,
146-
width_high = width_high,
147-
missing = missing,
148-
zap_small = zap_small
149-
)
150-
)
151151
}
152152
}
153153

@@ -159,9 +159,9 @@ format_ci.numeric <- function(CI_low,
159159
format_ci.bayestestR_ci <- function(CI_low, ...) {
160160
x <- as.data.frame(CI_low)
161161
format_ci(
162-
CI_low=x$CI_low,
163-
CI_high=x$CI_high,
164-
ci=x$CI,
162+
CI_low = x$CI_low,
163+
CI_high = x$CI_high,
164+
ci = x$CI,
165165
...
166166
)
167167
}

man/format_ci.Rd

Lines changed: 32 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)