Skip to content

Commit

Permalink
fix some check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebaron committed May 20, 2024
1 parent 3289aaf commit 9761d29
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ importFrom(rlang,as_string)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,env_clone)
importFrom(rlang,expr)
importFrom(rlang,have_name)
importFrom(rlang,is_atomic)
importFrom(rlang,is_empty)
Expand Down
2 changes: 1 addition & 1 deletion R/AAAA.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @importFrom tidyr complete
#' @importFrom forcats fct_inorder
#' @importFrom rlang sym syms quo_get_expr as_string := .data .env is_empty
#' @importFrom rlang enquo enquos is_named is_atomic have_name
#' @importFrom rlang enquo enquos expr is_named is_atomic have_name
#' @importFrom rlang env_clone abort
#' @importFrom glue glue
#' @importFrom tibble tibble as_tibble is_tibble
Expand Down
13 changes: 10 additions & 3 deletions R/glossary.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ read_yaml_glossary <- function(file) {
abort("yaml/yml glossary format requires names label, abb, and def.")
}
labels <- parsed[["label"]]
parsed <- select(parsed, abb, def)
parsed <- select(parsed, "abb", "def")
data <- split(parsed, seq(nrow(parsed)))
data <- lapply(data, unlist)
data <- lapply(data, as_glossary_entry)
Expand Down Expand Up @@ -201,7 +201,7 @@ abort_bad_glo_labels <- function(x, what) {
#'
#' glossary_notes(file, WT, CRCL)
#'
#' g <- as_glossary(list(ss = "steady state", ALB = "albumin"), WT = "weight")
#' g <- as_glossary(list(ss = "steady state", ALB = "albumin", WT = "weight"))
#'
#' glossary_notes(g, ALB, ss)
#'
Expand Down Expand Up @@ -248,9 +248,11 @@ build_glossary_notes <- function(glossary, labels, sep, collapse) {

#' @export
print.glossary_entry <- function(x, ...) {
print(paste0(x$definition, " (", x$abbreviation, ")"))
print(ans <- paste0(x$definition, " (", x$abbreviation, ")"))
}

#' @param x a glossary object.
#' @param ... not used.
#' @export
print.glossary <- function(x, ...) {
label <- names(x)
Expand All @@ -262,6 +264,9 @@ print.glossary <- function(x, ...) {
cat(paste0(label, " : ", def), sep = "\n")
}

#' @param x a glossary object.
#' @param ... not used.
#'
#' @export
as.data.frame.glossary <- function(x, ...) {
data.frame(
Expand All @@ -272,6 +277,8 @@ as.data.frame.glossary <- function(x, ...) {
)
}

#' @param x a glossary object.
#' @param ... not used.
#' @export
as.list.glossary <- function(x, ...) {
class(x) <- "list"
Expand Down
2 changes: 1 addition & 1 deletion R/table-object.R
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ st_notes_conf <- st_noteconf
#' @examples
#' library(dplyr)
#'
#' file <- system.file("tex", "glossary.tex", package = "pmtables")
#' file <- system.file("glo", "glossary.tex", package = "pmtables")
#'
#' x <- read_glossary(file)
#'
Expand Down
2 changes: 1 addition & 1 deletion man/glossary_notes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/st_notes_glo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9761d29

Please sign in to comment.