Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning message with nested summarize_row_groups #200

Closed
anajens opened this issue May 10, 2021 · 3 comments
Closed

Warning message with nested summarize_row_groups #200

anajens opened this issue May 10, 2021 · 3 comments

Comments

@anajens
Copy link
Contributor

anajens commented May 10, 2021

I guess this related to the use character analysis variable (eg l3 below) but wanted to report here just in case it's a bug.

library(rtables)

dat2 <- data.frame(
  l1 = factor(c("A", "B")),
  l2 = factor(c("aa1", "bb1")),
  l3 = c("aaa1", "bbb1"),
  stringsAsFactors = FALSE
)

basic_table() %>%
  split_rows_by("l1") %>%
  summarize_row_groups() %>%
  split_rows_by("l2") %>%
  summarize_row_groups() %>%
  split_rows_by("l3") %>%
  summarize_row_groups() %>%
  build_table(dat2)

Creates the table but there is a warning:

           all obs
------------------
A          1 (50%)
  aa1      1 (50%)
    aaa1   1 (50%)
  bb1      0 (0%) 
B          1 (50%)
  aa1      0 (0%) 
  bb1      1 (50%)
    bbb1   1 (50%
Warning messages:
1: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
2: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
3: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
4: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
5: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
6: In max(kiddfs$abs_rownumber, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf

Session info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C              LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rtables_0.3.7.0004 magrittr_2.0.1    

loaded via a namespace (and not attached):
[1] compiler_3.6.3  htmltools_0.4.0 tools_3.6.3     Rcpp_1.0.4.6    digest_0.6.25   packrat_0.5.0   rlang_0.4.9   
@gmbecker
Copy link
Collaborator

The above commit passed the tests. I twas bundled with another commit.

The issue was actually that these content rows don't have any rows underneath them, which because of how I deal with that was causing those warnings but that is now fixed with a regression test.

I will say having content row summaries with no analyze under them like this is likely to make pagination behave weirdly, so should probably generally be avoided unless its really necessary.

@gmbecker gmbecker added this to ToDo in May - Jul 2021 via automation May 10, 2021
@gmbecker gmbecker moved this from ToDo to Done in May - Jul 2021 May 10, 2021
@anajens
Copy link
Contributor Author

anajens commented May 11, 2021

Hi @gmbecker would you be able to update devel branch with these commits that add the fix?

@gmbecker
Copy link
Collaborator

gmbecker commented May 11, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants