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

Clean up summary functions #461

Merged
merged 43 commits into from
Sep 5, 2024
Merged

Clean up summary functions #461

merged 43 commits into from
Sep 5, 2024

Commits on Aug 30, 2024

  1. purely cosmetic changes

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    943121d View commit details
    Browse the repository at this point in the history
  2. use a single paste0()

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    6de4e78 View commit details
    Browse the repository at this point in the history
  3. no need ot do.call(rbind, ...) or apply(..., paste): just paste the f…

    …irst and second elements in x$design_par; also use gsub(fixed = TRUE) to avoid escaping parentheses as \(\)
    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    b26ed32 View commit details
    Browse the repository at this point in the history
  4. use a regular expression \\U to capitalize the first letter

    an alternative way is a loop:
    
      for (i in c("design", "n", "event", "time", "bound", "power")) {
        # special case: Event -> Events
        names(ans)[names(ans) == i] <- if (i == "event") "Events" else {
          # capitalize the first letter
          sub("^(.)", "\\U\\1", i, perl = TRUE)
        }
      }
    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    59047f3 View commit details
    Browse the repository at this point in the history
  5. extra ,

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    f163e05 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    45f7a59 View commit details
    Browse the repository at this point in the history
  7. always add newline to files

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    a0830bd View commit details
    Browse the repository at this point in the history
  8. factor out get_method()

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    23f4207 View commit details
    Browse the repository at this point in the history
  9. merge all these if statements

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    ea50328 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0c3190e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    cefeb5f View commit details
    Browse the repository at this point in the history
  12. untangle this complicated if-else hairball

    the pattern `x[match(y, names(x))]` could win an unmatched award... it should have been simply `x[y]`
    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    e3eaa16 View commit details
    Browse the repository at this point in the history
  13. factor out replace_values()

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    a405832 View commit details
    Browse the repository at this point in the history
  14. batch capitalize variable names

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    fdf14ae View commit details
    Browse the repository at this point in the history
  15. the mutate_at() can be a simple <- assignment to column, and the …

    …`filter()` can be simply indexing by name from `col_decimals`; then all `if` statments can be merged into a `for` loop
    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    df565fd View commit details
    Browse the repository at this point in the history
  16. use add_class()

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    84a2754 View commit details
    Browse the repository at this point in the history
  17. use %||%

    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    920b18c View commit details
    Browse the repository at this point in the history
  18. store col_vars in the names of col_decimals, and use names when we ne…

    …ed to access the col_vars
    yihui committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    b263d07 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2024

  1. factor out get_decimals()

    yihui committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    84c46db View commit details
    Browse the repository at this point in the history
  2. also apply get_decimals() to analysis variables and decimals, and ren…

    …ame columns in `analyses`
    yihui committed Aug 31, 2024
    Configuration menu
    Copy the full SHA
    08674f9 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2024

  1. Configuration menu
    Copy the full SHA
    7401dbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    59c939c View commit details
    Browse the repository at this point in the history
  3. the columns have already been renamed before, and bound names have al…

    …so been updated, so only need to add the `Null hypothesis` column
    yihui committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    2b3de00 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Configuration menu
    Copy the full SHA
    c18b536 View commit details
    Browse the repository at this point in the history
  2. simplify table_ab()

    yihui committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    a54fcf2 View commit details
    Browse the repository at this point in the history
  3. rewrite round_df()

    yihui committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    d223dc0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    004af38 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. factor out x$design_par

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    2c70436 View commit details
    Browse the repository at this point in the history
  2. use the rename function

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    0a69d8b View commit details
    Browse the repository at this point in the history
  3. rename_to -> replace_names

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    b7c5c87 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d00be63 View commit details
    Browse the repository at this point in the history
  5. cosmetic

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    3c505d9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c7ab5be View commit details
    Browse the repository at this point in the history
  7. one assignment

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    9cde29a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    494e354 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    df032cc View commit details
    Browse the repository at this point in the history
  10. unnecessary to create the two objects analysis_header and `bound_de…

    …tails`; just use `analyses` and `xy`
    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    f724c3b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    774e3e4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9d66828 View commit details
    Browse the repository at this point in the history
  13. <- [ci skip]

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    92d2bfe View commit details
    Browse the repository at this point in the history
  14. import stats for setNames()

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    4f1de2a View commit details
    Browse the repository at this point in the history
  15. explain the substitute() trick

    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    b1a18fb View commit details
    Browse the repository at this point in the history
  16. only import stats::setNames() since stats has filter(), which conflic…

    …ts with dplyr::filter()
    yihui committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    9ba6c87 View commit details
    Browse the repository at this point in the history