Skip to content

Commit fe26b1c

Browse files
committed
add back knit_print.alpha
1 parent 5604372 commit fe26b1c

File tree

96 files changed

+3222
-1413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3222
-1413
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export(ended)
4040
export(expired)
4141
export(has_label)
4242
export(has_labels)
43+
export(knit_print.alpha)
4344
export(label_browser)
4445
export(label_browser_static)
4546
export(likert_from_items)

R/label_browser.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ label_browser_static <- function(data = NULL, viewer = rstudioapi::viewer) {
6969
"\n", "<br>")
7070
}
7171

72-
DT::datatable(labels,
72+
DT::formatSignif(DT::datatable(labels,
7373
caption = paste(df_name, " columns and labels"),
7474
filter = 'top',
7575
escape = FALSE,
@@ -80,7 +80,8 @@ label_browser_static <- function(data = NULL, viewer = rstudioapi::viewer) {
8080
# dom = 't',
8181
paging = FALSE
8282
)
83-
)
83+
), intersect(names(labels), c("complete_rate",
84+
"mean", "sd")))
8485
}
8586

8687
#' Browse and search variable and value labels

R/psych_print.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,21 @@ knit_print.htest <- function(x, ...) {
3333
paste0(utils::capture.output(print(x)), collapse = "\n"),
3434
"\n```\n\n\n"))
3535
}
36+
37+
38+
#' Pretty-print a Cronbach's alpha object
39+
#'
40+
#' Turn a [psych::alpha()] object into HTML tables.
41+
#'
42+
#' @param x a psych alpha object
43+
#' @param indent add # to this to make the headings in the components lower-level. defaults to beginning at h5
44+
#' @param ... ignored
45+
#'
46+
#' @export
47+
#' @examples
48+
#' example("alpha", "psych")
49+
#' knitr::knit_print(a4)
50+
#'
51+
knit_print.alpha <- function(x, indent = '######', ...) {
52+
rmdpartials::partial(require_file("_knit_print_psych.Rmd"))
53+
}

docs/404.html

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

docs/CONDUCT.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE-text.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)