library(chevron)
library(citril)
# Create a list of ggplot objects
graph <- chevron::run(chevron::mng01, chevron::syn_data, dataset = "adlb")
# decorate with a long title and subtitle
res <- decorate_tlg(
graph,
main = append_filter_title(
paste("My", paste(rep("very", 55), collapse = " "), "long title"),
suffix = c("PP", "SE", "CNCM", "PAXIS"),
targets = c("adsl", "adcm")
),
sub = paste("My", paste(rep("very", 55), collapse = " "), "long subtitle"),
footnote = paste("My", paste(rep("very", 100), collapse = " "), "long footnote"),
sup_footnote = paste("My", paste(rep("very", 100), collapse = " "), "long supplementary footnote")
)
# extract the title from the grob
lab <- res[[1]]$children$titles_grob_footnotes$children[[1]]$label
# the length of the individual lines in the title has changes and is a bit surprising
wrapped_lab <- stringr::str_split(lab, "\\n", simplify = FALSE)
expect_identical(nchar(wrapped_lab[[1]]), c(182L, 180L, 182L, 108L))
# Error: nchar(wrapped_lab[[1]]) (`actual`) not identical to c(182L, 180L, 182L, 108L) (`expected`).
#
# `actual`: 172 166 23 147 143
# `expected`: 182 180 182 108
The error seems to arise in tern::decorate_grob_set(), the concatenation of the title and subtitle let the system think that the line is longer than it actually is.
What happened?
example:
The error seems to arise in
tern::decorate_grob_set()
, the concatenation of the title and subtitle let the system think that the line is longer than it actually is.thank you for the help
sessionInfo()
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy