diff --git a/.github/workflows/deploy_bookdown.yml b/.github/workflows/deploy_bookdown.yml index 258a30449..6fd98bafb 100644 --- a/.github/workflows/deploy_bookdown.yml +++ b/.github/workflows/deploy_bookdown.yml @@ -13,7 +13,7 @@ jobs: concurrency: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: - GITHUB_PAT: ${{ secrets.GITHUB_PAT }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} EMAIL: ${{ secrets.EMAIL }} steps: # Checkout repository @@ -54,7 +54,7 @@ jobs: install.packages(c("tidyverse", "bookdown")); }' env: - GITHUB_PAT: ${{ secrets.GITHUB_PAT }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} # Install and cache TinyTeX only if needed - name: Install TinyTeX if Needed diff --git a/02-visualization.Rmd b/02-visualization.Rmd index f947b5f93..cabc021e5 100755 --- a/02-visualization.Rmd +++ b/02-visualization.Rmd @@ -109,7 +109,7 @@ In February 2006, a Swedish physician and data advocate named Hans Rosling gave ```{r gapminder-2007, echo=FALSE, purl=FALSE} gapminder_2007 %>% head(3) %>% - kable( + kbl( digits = 2, caption = "Gapminder 2007 Data: First 3 of 142 countries" # , ) %>% @@ -166,7 +166,7 @@ tibble( aes = c("x", "y", "size", "color"), geom = c("point", "point", "point", "point") ) %>% - kable( + kbl( caption = "Summary of the grammar of graphics for this plot", booktabs = TRUE, linesep = "" @@ -881,7 +881,7 @@ Observe in Figure \@ref(fig:flightsbar) that United Airlines (UA), JetBlue Airwa flights_counted <- flights %>% group_by(carrier) %>% summarize(number = n()) -kable(flights_counted, +kbl(flights_counted, digits = 3, caption = "Number of flights pre-counted for each carrier", booktabs = TRUE, @@ -1151,7 +1151,7 @@ if (is_latex_output()) { summary_table_ch2 %>% # Weird tick marks show up in PDF: mutate(`Geometric object` = str_replace_all(`Geometric object`, "`", "")) %>% - kable( + kbl( caption = "Summary of Five Named Graphs", booktabs = TRUE, format = "latex", @@ -1163,7 +1163,7 @@ if (is_latex_output()) { column_spec(5, width = "1.6in") } else { summary_table_ch2 %>% - kable( + kbl( caption = "Summary of Five Named Graphs", booktabs = TRUE, format = "html" diff --git a/03-wrangling.Rmd b/03-wrangling.Rmd index 05fd371aa..cc1fe06cf 100755 --- a/03-wrangling.Rmd +++ b/03-wrangling.Rmd @@ -485,7 +485,7 @@ Let's take a look at only the `dep_delay`, `arr_delay`, and the resulting `gain` flights %>% select(dep_delay, arr_delay, gain) %>% slice(1:5) %>% - kable( + kbl( caption = "First five rows of departure/arrival delay and gain variables" ) %>% kable_styling(position = "center", latex_options = "hold_position") @@ -872,7 +872,7 @@ if (is_latex_output()) { Verb = str_replace_all(Verb, "`", ""), `Data wrangling operation` = str_replace_all(`Data wrangling operation`, "`", ""), ) %>% - kable( + kbl( caption = "Summary of data wrangling verbs", booktabs = TRUE, linesep = "", diff --git a/04-tidy.Rmd b/04-tidy.Rmd index 757332400..666f8bc31 100755 --- a/04-tidy.Rmd +++ b/04-tidy.Rmd @@ -225,7 +225,7 @@ stocks <- tibble( ) %>% slice(1:2) stocks %>% - kable( + kbl( digits = 2, caption = "Stock prices (non-tidy format)", booktabs = TRUE, @@ -253,7 +253,7 @@ stocks_tidy <- stocks %>% values_to = "Stock Price" ) stocks_tidy %>% - kable( + kbl( digits = 2, caption = "Stock prices (tidy format)", booktabs = TRUE, @@ -275,7 +275,7 @@ stocks <- tibble( ) %>% slice(1:2) stocks %>% - kable( + kbl( digits = 2, caption = "Example of tidy data" # , # booktabs = TRUE diff --git a/05-regression.Rmd b/05-regression.Rmd index 9cf03de32..372f80088 100755 --- a/05-regression.Rmd +++ b/05-regression.Rmd @@ -178,7 +178,7 @@ evals_ch5 %>% ```{r five-random-courses, echo=FALSE, purl=FALSE} evals_ch5 %>% sample_n(5) %>% - kable( + kbl( digits = 3, caption = "A random sample of 5 out of the 463 courses at UT Austin", booktabs = TRUE, @@ -429,7 +429,7 @@ evals_line <- score_model %>% ``` ```{r regtable, echo=FALSE, purl=FALSE} get_regression_table(score_model) %>% - kable( + kbl( digits = 3, caption = "Linear regression table", booktabs = TRUE, @@ -516,7 +516,7 @@ y_hat <- target_point$score_hat resid <- target_point$residual evals_ch5 %>% slice(index) %>% - kable( + kbl( digits = 4, caption = "Data for the 21st course out of 463", booktabs = TRUE, @@ -694,7 +694,7 @@ gapminder2007 %>% sample_n(size = 5) ```{r model2-data-preview, echo=FALSE, purl=FALSE} gapminder2007 %>% sample_n(5) %>% - kable( + kbl( digits = 3, caption = "Random sample of 5 out of 142 countries", booktabs = TRUE, @@ -872,7 +872,7 @@ gapminder2007 %>% group_by(continent) %>% summarize(mean = mean(lifeExp)) %>% mutate(`Difference versus Africa` = mean - mean_africa) %>% - kable( + kbl( digits = 3, caption = "Mean life expectancy by continent and relative differences from mean for Africa", booktabs = TRUE, @@ -916,7 +916,7 @@ lifeExp_model <- lm(lifeExp ~ continent, data = gapminder2007) ``` ```{r catxplot4b, echo=FALSE, purl=FALSE} get_regression_table(lifeExp_model) %>% - kable( + kbl( digits = 3, caption = "Linear regression table", booktabs = TRUE, @@ -1059,7 +1059,7 @@ regression_points regression_points <- get_regression_points(lifeExp_model, ID = "country") regression_points %>% slice(1:10) %>% - kable( + kbl( digits = 3, caption = "Regression points (First 10 out of 142 countries)", booktabs = TRUE, @@ -1302,7 +1302,7 @@ get_regression_table(score_model) ```{r recall-table, echo=FALSE, purl=FALSE} score_model <- lm(score ~ bty_avg, data = evals_ch5) get_regression_table(score_model) %>% - kable( + kbl( digits = 3, caption = "Regression table", booktabs = TRUE, @@ -1341,7 +1341,7 @@ score_model %>% lower_ci = conf_low, upper_ci = conf_high ) %>% - kable( + kbl( digits = 3, caption = "Regression table using tidy() from broom package", booktabs = TRUE, @@ -1375,7 +1375,7 @@ score_model %>% clean_names() %>% select(-c("std_resid", "hat", "sigma", "cooksd", "std_resid")) %>% slice(1:10) %>% - kable( + kbl( digits = 3, caption = "Regression points using augment() from broom package", booktabs = TRUE, diff --git a/06-multiple-regression.Rmd b/06-multiple-regression.Rmd index 5a2042cba..3b4b983dd 100644 --- a/06-multiple-regression.Rmd +++ b/06-multiple-regression.Rmd @@ -130,7 +130,7 @@ evals_ch6 %>% sample_n(size = 5) ```{r model4-data-preview, echo=FALSE, purl=FALSE} evals_ch6 %>% sample_n(5) %>% - kable( + kbl( digits = 3, caption = "A random sample of 5 out of the 463 courses at UT Austin", booktabs = TRUE, @@ -221,7 +221,7 @@ lifeExp_model <- lm(lifeExp ~ continent, data = gapminder2007) # Get regression table and kable output get_regression_table(lifeExp_model) %>% - kable( + kbl( digits = 3, caption = "Regression table for life expectancy as a function of continent", booktabs = TRUE, @@ -267,7 +267,7 @@ get_regression_table(score_model_interaction) ```{r regtable-interaction, echo=FALSE, purl=FALSE} score_model_interaction <- lm(score ~ age * gender, data = evals_ch6) get_regression_table(score_model_interaction) %>% - kable( + kbl( digits = 3, caption = "Regression table for interaction model", booktabs = TRUE, @@ -312,7 +312,7 @@ tibble( Intercept = c(intercept_female, intercept_male), `Slope for age` = c(slope_female, slope_male) ) %>% - kable( + kbl( digits = 4, caption = "Comparison of intercepts and slopes for interaction model", booktabs = TRUE, @@ -429,7 +429,7 @@ get_regression_table(score_model_parallel_slopes) ```{r regtable-parallel-slopes, echo=FALSE, purl=FALSE} score_model_parallel_slopes <- lm(score ~ age + gender, data = evals_ch6) get_regression_table(score_model_parallel_slopes) %>% - kable( + kbl( digits = 3, caption = "Regression table for parallel slopes model", booktabs = TRUE, @@ -469,7 +469,7 @@ tibble( Intercept = c(intercept_female_parallel, intercept_male_parallel), `Slope for age` = c(age_coef, age_coef) ) %>% - kable( + kbl( digits = 4, caption = "Comparison of intercepts and slope for parallel slopes model", booktabs = TRUE, @@ -595,7 +595,7 @@ regression_points regression_points <- get_regression_points(score_model_interaction) regression_points %>% slice(1:10) %>% - kable( + kbl( digits = 3, caption = "Regression points (First 10 out of 463 courses)" # , # booktabs = TRUE @@ -668,7 +668,7 @@ credit_ch6 %>% sample_n(size = 5) ```{r model3-data-preview, echo=FALSE, purl=FALSE} credit_ch6 %>% sample_n(5) %>% - kable( + kbl( digits = 3, caption = "Random sample of 5 credit card holders", booktabs = TRUE, @@ -720,7 +720,7 @@ credit_ch6 %>% credit_ch6 %>% select(debt, credit_limit, income) %>% cor() %>% - kable( + kbl( digits = 3, caption = "Correlation coefficients between credit card debt, credit limit, and income", booktabs = TRUE, @@ -874,7 +874,7 @@ debt_model <- lm(debt ~ credit_limit + income, data = credit_ch6) credit_line <- get_regression_table(debt_model) %>% pull(estimate) get_regression_table(debt_model) %>% - kable( + kbl( digits = 3, caption = "Multiple regression table", booktabs = TRUE, @@ -941,7 +941,7 @@ set.seed(76) regression_points <- get_regression_points(debt_model) regression_points %>% slice(1:10) %>% - kable( + kbl( digits = 3, caption = "Regression points (First 10 credit card holders out of 400)", booktabs = TRUE, @@ -1062,7 +1062,7 @@ model_2_interaction <- lm(average_sat_math ~ perc_disadvan * size, data = MA_schools ) get_regression_table(model_2_interaction) %>% - kable( + kbl( digits = 3, caption = "Interaction model regression table", booktabs = TRUE, @@ -1083,7 +1083,7 @@ model_2_parallel_slopes <- lm(average_sat_math ~ perc_disadvan + size, data = MA_schools ) get_regression_table(model_2_parallel_slopes) %>% - kable( + kbl( digits = 3, caption = "Parallel slopes regression table", booktabs = TRUE, @@ -1178,7 +1178,7 @@ bind_rows( variances_parallel_slopes ) %>% select(model, var_y, var_y_hat, var_residual, r_squared) %>% - knitr::kable( + kbl( digits = 3, caption = "Comparing variances from interaction and parallel slopes models for MA school data", booktabs = TRUE, @@ -1205,7 +1205,7 @@ bind_rows( variances_parallel_slopes ) %>% select(model, var_y, var_y_hat, var_residual, r_squared) %>% - knitr::kable( + kbl( digits = 3, caption = "Comparing variances from interaction and parallel slopes models for UT Austin data", booktabs = TRUE, @@ -1244,7 +1244,7 @@ credit_ch6 %>% select(debt, income) %>% mutate(income = income * 1000) %>% cor() %>% - kable( + kbl( digits = 3, caption = "Correlation between income (in dollars) and credit card debt", booktabs = TRUE, @@ -1274,7 +1274,7 @@ debt_model <- lm(debt ~ credit_limit + income, data = credit_ch6) credit_line <- get_regression_table(debt_model) %>% pull(estimate) get_regression_table(debt_model) %>% - kable( + kbl( digits = 3, caption = "Multiple regression results", booktabs = TRUE, diff --git a/07-sampling.Rmd b/07-sampling.Rmd index e70de3480..d20247940 100644 --- a/07-sampling.Rmd +++ b/07-sampling.Rmd @@ -621,7 +621,7 @@ comparing_n_table <- virtual_prop %>% rename(`Number of slots in shovel` = n, `Standard deviation of proportions red` = sd) comparing_n_table %>% - kable( + kbl( digits = 3, caption = "Comparing standard deviations of proportions red for three different shovels", booktabs = TRUE, @@ -817,7 +817,7 @@ comparing_n_table <- virtual_prop %>% rename(`Number of slots in shovel` = n, `Standard deviation of proportions red` = sd) comparing_n_table %>% - kable( + kbl( digits = 3, caption = "Previously seen comparing standard deviations of proportions red for three different shovels", booktabs = TRUE, @@ -873,7 +873,7 @@ comparing_n_table <- virtual_prop %>% rename(`Sample size (n)` = n, `Standard error of $\\widehat{p}$` = sd) comparing_n_table %>% - kable( + kbl( digits = 3, caption = "Standard errors of the sample proportion based on sample sizes of 25, 50, and 100", booktabs = TRUE, @@ -985,7 +985,7 @@ comparing_n_table <- virtual_prop %>% sample_frac(1) comparing_n_table %>% - kable( + kbl( digits = 3, caption = "Standard errors of $\\widehat{p}$ based on n = 25, 50, 100", booktabs = TRUE, @@ -1177,7 +1177,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { } sampling_scenarios %>% - kable( + kbl( caption = "\\label{tab:summarytable-ch8}Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, diff --git a/08-confidence-intervals.Rmd b/08-confidence-intervals.Rmd index 9732f7e3c..671b0b46b 100755 --- a/08-confidence-intervals.Rmd +++ b/08-confidence-intervals.Rmd @@ -166,7 +166,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% # Only first two scenarios filter(Scenario <= 2) %>% - kable( + kbl( caption = "Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, @@ -1566,7 +1566,7 @@ percentile_cis_by_level %>% group_by(confidence_level) %>% summarize(`Mean width` = mean(width)) %>% rename(`Confidence level` = confidence_level) %>% - kable( + kbl( digits = 3, caption = "Average width of 80, 95, and 99\\% confidence intervals", booktabs = TRUE, @@ -1689,7 +1689,7 @@ percentile_cis_by_n %>% group_by(sample_size) %>% summarize(`Mean width` = mean(width)) %>% rename(`Sample size` = sample_size) %>% - kable( + kbl( digits = 3, caption = "Average width of 95\\% confidence intervals based on $n = 25$, $50$, and $100$", booktabs = TRUE, @@ -1775,7 +1775,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% # Only first two scenarios filter(Scenario <= 3) %>% - kable( + kbl( caption = "Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, @@ -2185,7 +2185,7 @@ tibble( `Distribution type` = c("Sampling distribution", "Bootstrap distribution"), `Standard error` = c(se_samp, se_boot) ) %>% - kable( + kbl( caption = "Comparing standard errors", digits = 3, booktabs = TRUE, @@ -2231,7 +2231,7 @@ tibble( ), `Standard error` = c(se_samp, se_boot, 0.0698) ) %>% - kable( + kbl( caption = "Comparing standard errors", digits = 3, booktabs = TRUE, diff --git a/09-hypothesis-testing.Rmd b/09-hypothesis-testing.Rmd index 04727a60e..e18eb08cb 100755 --- a/09-hypothesis-testing.Rmd +++ b/09-hypothesis-testing.Rmd @@ -181,7 +181,7 @@ promotions_sample <- promotions %>% select(`résumé number`, everything()) promotions_sample %>% - kable( + kbl( caption = "One example of shuffling gender variable", booktabs = TRUE, longtable = TRUE, @@ -415,7 +415,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% # Only first two scenarios filter(Scenario <= 3) %>% - kable( + kbl( caption = "Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, @@ -1104,7 +1104,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% filter(Scenario %in% c(1:4)) %>% - kable( + kbl( caption = "Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, @@ -1625,7 +1625,7 @@ get_regression_table(score_model) score_model <- lm(score ~ bty_avg, data = evals) # Get regression table: get_regression_table(score_model) %>% - kable( + kbl( digits = 3, caption = "Linear regression table", booktabs = TRUE, diff --git a/10-inference-for-regression.Rmd b/10-inference-for-regression.Rmd index 16a9aeeb3..754992e5a 100644 --- a/10-inference-for-regression.Rmd +++ b/10-inference-for-regression.Rmd @@ -112,7 +112,7 @@ get_regression_table(score_model) # Fit regression model: score_model <- lm(score ~ bty_avg, data = evals_ch5) get_regression_table(score_model) %>% - kable( + kbl( digits = 3, caption = "Previously seen linear regression table", booktabs = TRUE, @@ -195,7 +195,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% # filter(Scenario %in% 1:5) %>% - kable( + kbl( caption = "Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, @@ -224,7 +224,7 @@ We've so far focused only on the two leftmost columns of the regression table in ```{r score-model-part-deux, echo=FALSE, purl=FALSE} get_regression_table(score_model) %>% - kable( + kbl( caption = "Previously seen regression table", digits = 3, booktabs = TRUE, @@ -853,7 +853,7 @@ if (!file.exists("rds/sampling_scenarios.rds")) { sampling_scenarios %>% filter(Scenario %in% 1:6) %>% - kable( + kbl( caption = "\\label{tab:summarytable-ch9}Scenarios of sampling for inference", booktabs = TRUE, escape = FALSE, diff --git a/11-tell-your-story-with-data.Rmd b/11-tell-your-story-with-data.Rmd index a51c24fc9..e396930d0 100755 --- a/11-tell-your-story-with-data.Rmd +++ b/11-tell-your-story-with-data.Rmd @@ -454,7 +454,7 @@ price_interaction <- lm(log10_price ~ log10_size * condition, data = house_prices ) get_regression_table(price_interaction) %>% - kable( + kbl( digits = 3, caption = "Regression table for interaction model", booktabs = TRUE, diff --git a/bib/packages.bib b/bib/packages.bib index 60f015bbb..59792e725 100644 --- a/bib/packages.bib +++ b/bib/packages.bib @@ -11,7 +11,7 @@ @Manual{R-bookdown title = {bookdown: Authoring Books and Technical Documents with R Markdown}, author = {Yihui Xie}, year = {2024}, - note = {R package version 0.40}, + note = {R package version 0.41}, url = {https://github.com/rstudio/bookdown}, } @@ -19,7 +19,7 @@ @Manual{R-broom title = {broom: Convert Statistical Objects into Tidy Tibbles}, author = {David Robinson and Alex Hayes and Simon Couch}, year = {2024}, - note = {R package version 1.0.6}, + note = {R package version 1.0.7}, url = {https://broom.tidymodels.org/}, } @@ -67,9 +67,9 @@ @Manual{R-ggplot2movies @Manual{R-infer, title = {infer: Tidy Statistical Inference}, author = {Andrew Bray and Chester Ismay and Evgeni Chasnovski and Simon Couch and Ben Baumer and Mine Cetinkaya-Rundel}, - year = {2024}, - note = {R package version 1.0.7}, + note = {R package version 1.0.7.9000}, url = {https://github.com/tidymodels/infer}, + year = {2024}, } @Manual{R-janitor, @@ -92,7 +92,7 @@ @Manual{R-knitr title = {knitr: A General-Purpose Package for Dynamic Report Generation in R}, author = {Yihui Xie}, year = {2024}, - note = {R package version 1.48}, + note = {R package version 1.49}, url = {https://yihui.org/knitr/}, } @@ -124,7 +124,7 @@ @Manual{R-rmarkdown title = {rmarkdown: Dynamic Documents for R}, author = {JJ Allaire and Yihui Xie and Christophe Dervieux and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone}, year = {2024}, - note = {R package version 2.28}, + note = {R package version 2.29}, url = {https://github.com/rstudio/rmarkdown}, }