Skip to content

Commit

Permalink
Merge branch 'main' into edit-headings
Browse files Browse the repository at this point in the history
  • Loading branch information
szimmer committed Mar 31, 2024
2 parents 031d17f + 9f41856 commit 47f5bef
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy_bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.1'
use-public-rspm: true
use-public-rspm: false
extra-repositories: 'CRAN'
- uses: r-lib/actions/setup-pandoc@v2
- name: Set RENV_PATHS_ROOT
shell: bash
Expand Down
228 changes: 159 additions & 69 deletions 01-introduction.Rmd

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 08-communicating-results.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ trust_gov <- anes_des %>%
trust_gov
```

The default output generated by R may work for initial viewing inside RStudio or when creating basic output in an R Markdown or Quarto document. However, when presenting these results in other publications, such as the print version of this book or with other formal dissemination modes, modifying the display can improve our reader's experience.
The default output generated by R may work for initial viewing inside our IDE or when creating basic output in an R Markdown or Quarto document. However, when presenting these results in other publications, such as the print version of this book or with other formal dissemination modes, modifying the display can improve our reader's experience.

Looking at the output from `trust_gov`, a couple of improvements are obvious: (1) switching to percentages instead of proportions and (2) using the variable names as column headers. The {gt} package is a good tool for implementing better labeling and creating publishable tables. Let's walk through some code as we make a few changes to improve the table's usefulness.

Expand Down
2 changes: 1 addition & 1 deletion 13-ncvs-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ pers_des <- pers_vsum_slim %>%

## Calculating estimates

Now that we have prepared our data and created the design effects, we can calculate our estimates. As a reminder, those are:
Now that we have prepared our data and created the design objects, we can calculate our estimates. As a reminder, those are:

1. *Victimization totals* estimate the number of criminal victimizations with a given characteristic.

Expand Down
24 changes: 16 additions & 8 deletions book.bib
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ @article{gelman2007weights
howpublished = {\url{https://doi.org/10.1214/088342306000000691}},
keywords = {multilevel modeling, poststratification, sampling weights, shrinkage}
}
@article{gard2023weightsdef,
title = {Why weight? Analytic approaches for large-scale population neuroscience data},
author = {Gard, Arianna M. and Hyde, Luke W. and Heeringa, Steven G. and West, Brady T. and Mitchell, Colter},
year = 2023,
journal = {Dev Cogn Neurosci},
doi = {10.1016/j.dcn.2023.101196},
howpublished = {\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9843279/}}
}
@article{bollen2016weightsreg,
title = {Are Survey Weights Needed? A Review of Diagnostic Tests in Regression Analysis},
author = {Bollen, Kenneth A. and Biemer, Paul P. and Karr, Alan F. and Tueller, Stephen and Berzofsky, Marcus E.},
Expand Down Expand Up @@ -245,6 +253,14 @@ @book{wickham2019advanced
publisher = {CRC press},
howpublished = {\url{https://adv-r.hadley.nz/}}
}
@book{wickham2023r4ds,
title = {R for Data Science},
author = {Wickham, Hadley and Çetinkaya-Rundel, Mine and Grolemund, Garrett},
year = 2023,
publisher = {O'Reilly},
edition = {2nd Edition},
howpublished = {\url{https://r4ds.hadley.nz/}}
}
@book{wickham2023ggplot2,
title = {ggplot2: Elegant Graphics for Data Analysis},
author = {Wickham, Hadley},
Expand All @@ -253,14 +269,6 @@ @book{wickham2023ggplot2
publisher = {Springer},
howpublished = {\url{https://ggplot2-book.org/}}
}
@book{wickham2023r4ds,
title = {R for Data Science: Import, Tidy, Transform, Visualize, and Model Data},
author = {Wickham, Hadley and Çetinkaya-Rundel, Mine and Grolemund, Garrett},
edition = {2rd Edition},
year = 2023,
publisher = {O'Reilly Media},
howpublished = {\url{https://r4ds.hadley.nz/}}
}
@misc{acs-pums-2021,
title = {{Understanding and Using the American Community Survey Public Use Microdata Sample Files What Data Users Need to Know}},
author = {{U.S. Census Bureau}},
Expand Down
2 changes: 1 addition & 1 deletion index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (knitr:::is_html_output()){
} else{
options(width=72)
}
library(formatR)
library(prettyunits)
book_colors <- c("#0b3954", "#087e8b", "#bfd7ea", "#ff8484", "#8d6b94")
Expand Down
23 changes: 13 additions & 10 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -696,16 +696,6 @@
],
"Hash": "1a0a9a3d5083d0d573c4214576f1e690"
},
"formatR": {
"Package": "formatR",
"Version": "1.14",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "63cb26d12517c7863f5abb006c5e0f25"
},
"fs": {
"Package": "fs",
"Version": "1.6.2",
Expand Down Expand Up @@ -1883,6 +1873,19 @@
],
"Hash": "3838071b66e0c566d55cc26bd6e27bf4"
},
"sessioninfo": {
"Package": "sessioninfo",
"Version": "1.2.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"tools",
"utils"
],
"Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f"
},
"sf": {
"Package": "sf",
"Version": "1.0-14",
Expand Down

0 comments on commit 47f5bef

Please sign in to comment.