Skip to content

[Bug]: g_lineplot example code with tables has bug in R 4.5.2 #1455

@snotman

Description

@snotman

What happened?

I am running the example code from Line plot with optional table.

The example works good in R 4.5.0/4.5.1 (windows 10/11)

but has error and failed to generate the pic in R 4.5.2 (windows 10/11)

R and tern/tidyverse packages are newly installed to excluded environmental issues.
Both tern&tidyverse packages are the latest release.

below is my code

library(tern)
adsl <- tern_ex_adsl
adlb <- tern_ex_adlb %>% dplyr::filter(ANL01FL == "Y", PARAMCD == "ALT", AVISIT != "SCREENING")
adlb$AVISIT <- droplevels(adlb$AVISIT)
adlb <- dplyr::mutate(adlb, AVISIT = forcats::fct_reorder(AVISIT, AVISITN, min))

# Mean with CI
g_lineplot(adlb, adsl, subtitle = "Laboratory Test:")


g_lineplot(
  adlb,
  whiskers = "mean_ci_upr",
  title = "Plot of Mean and Upper 95% Confidence Limit by Visit"
)

g_lineplot(adlb, adsl, table = c("n", "mean", "mean_ci"))

The first two figs without table are generated smoothly without any issue.

but the 'g_lineplot(adlb, adsl, table = c("n", "mean", "mean_ci"))' failed to generate the proper outcome.

Error in `dplyr::summarise()`:
ℹ In argument: `h_format_row(...)`.
ℹ In group 1: `ARM = A: Drug X` `AVISIT = BASELINE`.
Caused by error in `match.arg()`:
! 'arg' must be of length 1

sessionInfo()

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions