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

Referential Footnotes: Columns #187

Closed
waddella opened this issue Apr 26, 2021 · 2 comments
Closed

Referential Footnotes: Columns #187

waddella opened this issue Apr 26, 2021 · 2 comments

Comments

@waddella
Copy link
Contributor

No description provided.

@gmbecker
Copy link
Collaborator

@anajens Column referential footnotes are now supported (currently just in gabe_tabletree_work) as we were discussing in #219

@anajens
Copy link
Contributor

anajens commented Aug 17, 2021

Thanks for the update @gmbecker ! I tested a few cases and it's working well but I'm having some trouble adding footnotes via paths for layouts with add_overall_col. Any suggestions for what I'm doing wrong?

> race_levels <- c("WHITE",
+                  "BLACK OR AFRICAN AMERICAN",
+                  "ASIAN",
+                  "AMERICAN INDIAN OR ALASKA NATIVE",
+                  "MULTIPLE")
> 
> l1 <- basic_table() %>% 
+   split_cols_by("ARM") %>%
+   add_overall_col("ALL") %>%
+   add_colcounts() %>%
+   split_rows_by("RACE", split_fun = keep_split_levels(race_levels)) %>%
+   summarize_row_groups() %>%
+   analyze("AGE", mean)
> 
> tb1 <- build_table(l1, DM)
> tb1
                                      A: Drug X          B: Placebo       C: Combination          ALL       
                                       (N=121)            (N=106)            (N=129)            (N=356)     
------------------------------------------------------------------------------------------------------------
WHITE                                 14 (11.6%)         14 (13.2%)          18 (14%)          46 (12.9%)   
  mean                             39.3571428571429   36.9285714285714   35.1111111111111   36.9565217391304
BLACK OR AFRICAN AMERICAN             28 (23.1%)         24 (22.6%)         27 (20.9%)         79 (22.2%)   
  mean                             34.6785714285714   31.7083333333333          34          33.5443037974684
ASIAN                                 79 (65.3%)         68 (64.2%)         84 (65.1%)        231 (64.9%)   
  mean                             34.2025316455696   32.6764705882353   34.6309523809524   33.9090909090909
AMERICAN INDIAN OR ALASKA NATIVE        0 (0%)             0 (0%)             0 (0%)             0 (0%)     
  mean                                    NA                 NA                 NA                 NA       
MULTIPLE                                0 (0%)             0 (0%)             0 (0%)             0 (0%)     
  mean                                    NA                 NA                 NA                 NA       
> 
> col_paths_summary(tb1)
label             path               
-------------------------------------
A: Drug X         ARM, A: Drug X     
B: Placebo        ARM, B: Placebo    
C: Combination    ARM, C: Combination
ALL               ALL, ALL           
> 
> # Both these colpaths works
> value_at(tb1, rowpath = c("RACE", "WHITE", "@content", "WHITE"), colpath = c("ALL", "ALL"))
[1] 46.0000000  0.1292135
> value_at(tb1, rowpath = c("RACE", "WHITE", "@content", "WHITE"), colpath = c("ALL"))
[1] 46.0000000  0.1292135
> 
> # None of these colpaths work with adding a footnote
> fnotes_at_path(tb1, rowpath = NULL, colpath =  c("ALL", "ALL")) <-  c("test col footer - ALL")
Error in col_fnotes_at_path(coltree(ttrp), colpath, fnotes = value) : 
  Path appears invalid at step: ALL
> fnotes_at_path(tb1, rowpath = NULL, colpath =  c("ALL")) <-  c("test col footer - ALL")
Error in col_fnotes_at_path(coltree(ttrp), colpath, fnotes = value) : 
  Path appears invalid at step: ALL

gmbecker added a commit that referenced this issue Aug 27, 2021
* Exp allow a/cfuns + splfuns to accept .prev_splvals arg. #203 dev vbump

* Fix bug where names weren't showing up for .prev_splvals. #203 dev vbump

* Fix off-by-one error in pagination, sep in txt export.  Fixes #213

* add experimental fnotes_at_path function. Needs tests. #219. vbump

* Exp allow a/cfuns + splfuns to accept .prev_splvals arg. #203 dev vbump

* Fix bug where names weren't showing up for .prev_splvals. #203 dev vbump

* Fix off-by-one error in pagination, sep in txt export.  Fixes #213

* add experimental fnotes_at_path function. Needs tests. #219. vbump

* Run GH actions for all branches

* Working fntes_at_path with tests. Closes #219. dev vbump

* col ref footnote support. related to #219. Closes #187. dev vbump

* Support and tests for trim_levels_to_map. closes #203. Devel vbump.

* cell_values and value_at methods for Row objects. closes #210. dev vbump

* Trim outer levels to trim_levels_in_groups by deflt. #236 dev vbump

* Cleanup, additional tests, and fix bugs uncovered by new tests.

* Add NEWS entries, prepare for merge into main

Co-authored-by: dinakar29 <26552821+dinakar29@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants