BR-Visualization / brcharts

Create BR charts
https://br-visualization.github.io/brcharts/
MIT License
0 stars 0 forks source link

docs: Update pyramid_chart requirements for input data. #66

Closed Lovemore-Gakava closed 2 months ago

Lovemore-Gakava commented 2 months ago

Add input data requirements.

github-actions[bot] commented 2 months ago

Unit Tests Summary

  1 files    9 suites   12s :stopwatch:  60 tests  60 :white_check_mark: 0 :zzz: 0 :x: 410 runs  410 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 292e7a64.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 2 months ago

badge

Code Coverage Summary

Filename                           Stmts    Miss  Cover    Missing
-------------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------
R/check_feature.R                    345     300  13.04%   12-331, 360-364, 368-371, 386-390, 405-409, 427-431, 444-449
R/ci_calculation.R                    92       0  100.00%
R/correlogram.R                      135       0  100.00%
R/cumulative_excess_functions.R      347      40  88.47%   94-95, 105-106, 192-199, 236-247, 304-308, 443-451, 469-471
R/forest_dot_plot_utils.R           1493    1359  8.98%    16-1502, 1565-1567, 1584-1589, 1615-1618, 1639, 1704-1727, 1783-1800, 1814, 1817, 1885-2220
R/forest_dot_plot.R                  104     104  0.00%    4-254
R/grouped_barchart.R                  12      12  0.00%    36-48
R/line_chart.R                       136      20  85.29%   93-98, 119-120, 186-192, 209-213
R/order_label_der.R                   55      55  0.00%    35-97
R/pyramid_chart.R                     76       1  98.68%   64
R/scatterplot_function.R             121      13  89.26%   40-42, 70-81
R/stacked_barchart.R                  39       0  100.00%
R/tradeoff_plot.R                    890     424  52.36%   148-196, 290, 297-298, 302-303, 345-346, 355-365, 437-443, 452-456, 559-570, 757-786, 825-864, 890-1028, 1036-1090, 1126-1133, 1167-1277
R/utils.R                            289      37  87.20%   443-496, 523-529, 557-669
R/value_tree.R                         1       1  0.00%    45
TOTAL                               4135    2366  42.78%

Diff against main

Filename          Stmts    Miss  Cover
--------------  -------  ------  -------
R/value_tree.R      -12       0  -92.31%
TOTAL               -12       0  -0.17%

Results for commit: 292e7a64fa956077c004329affdb40267a41d67d

Minimum allowed coverage is 80%

:recycle: This comment has been updated with latest results

chen-chen-stat commented 2 months ago

@Lovemore-Gakava Thank you for the PR. As we have discussed in the meeting, I think the documentation is intended to describe the general requirements for the input data, while your documentation is specific to the example data. For example, although the example data have the variable names Age, Gender, Prevalence, Type, the input data do not have to follow these variable names. The variable names are flexible, and can be recognized by the function as long as they are specified in the yvar, groupvar, xvar, levelvar arguments. Thus, I suggest the following:

' @param data dataframe A data frame containing at least four columns: x-axis variable, y-axis variable, and two grouping variables.

' @param xvar string The column name in data representing the numeric values to be plotted

' on the x-axis, i.e., the lengths of the bars (e.g., "Prevalence" or a transformed version of it).

' This variable must be a numeric vector.

' @param yvar string The column name in data representing the categories to be plotted

' on the y-axis, i.e., the names of the bars (e.g., "Age").

' This variable must be a factor, character, or numeric vector.

' @param groupvar string The column name in data representing the binary groups

' to be displayed on each side of the pyramid (e.g., "Gender").

' This grouping variable must be a factor, character, or numeric vector with two levels.

' @param levelvar string The column name in data representing the grouping variable

' to create separate pyramids (e.g., "Type").

' This grouping variable must be a factor, character, or numeric vector.

' @param alpha_set numeric Specify the transparency of the bars in the chart (between 0 and 1).

' @param chartcolors vector A vector of two colors to be used for the two sides of the pyramid.

' @param xlab string Label for the x-axis.

Lovemore-Gakava commented 2 months ago

Thanks @chen-chen-stat Chen for the PR. I agree with your recommendations. The documentation should describe the general requirements for the input data, not just the example data. Code has now been updated.

github-actions[bot] commented 2 months ago

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
value_tree 💀 $0.06$ $-0.06$ $-8$ $0$ $0$ $0$
Additional test case details | Test Suite | $Status$ | Time on `main` | $±Time$ | Test Case | |:-----|:----:|:----:|:----:|:-----| | value_tree | 💀 | $0.00$ | $-0.00$ | value_tree_correctly_processes_complex_diagrams | | value_tree | 💀 | $0.01$ | $-0.01$ | value_tree_handles_empty_diagram | | value_tree | 💀 | $0.01$ | $-0.01$ | value_tree_handles_invalid_mermaid_syntax | | value_tree | 💀 | $0.01$ | $-0.01$ | value_tree_passes_additional_arguments_to_mermaid | | value_tree | 💀 | $0.00$ | $-0.00$ | value_tree_preserves_diagram_content | | value_tree | 💀 | $0.03$ | $-0.03$ | value_tree_returns_a_DiagrammeR_object |

Results for commit ea850c7fd74bd64763e9bc5af6055e8e24949558

♻️ This comment has been updated with latest results.

chen-chen-stat commented 2 months ago

Thank you @Lovemore-Gakava. I think the Rd file is still pending to be updated.

github-actions[bot] commented 2 months ago

Github pages

Review the pkgdown webpage for the PR here