Skip to content

Commit

Permalink
Edit Introduction Chapter (#114)
Browse files Browse the repository at this point in the history
* Edit Chapter 01 per feedback

* Remove reference to RStudio

* Update Introduction Chapter

* Small edit

* Small edit

* Small edits

* SZ intro review pt 1

* Table of packages in intro

* Remove loading of remotes

* Remove repeat bib entry, clean renv

* remove intermediate files

* Shorten sha in table

* Add chapter titles, intro feedback

* Apply suggestions from code review

---------

Co-authored-by: Stephanie Zimmer <[email protected]>
Co-authored-by: Rebecca Powell <[email protected]>
  • Loading branch information
3 people authored Mar 31, 2024
1 parent 449f197 commit 8e0880b
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 90 deletions.
223 changes: 154 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 @@ -602,7 +602,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 8e0880b

Please sign in to comment.