Skip to content

Commit

Permalink
Edit typo (#177)
Browse files Browse the repository at this point in the history
* Edit typo

* more read_dat instances and errata chapter added

* Update H-level on errata sections

* Unnumber headings in errata

---------

Co-authored-by: Stephanie Zimmer <[email protected]>
  • Loading branch information
ivelasq and szimmer authored Nov 11, 2024
1 parent 5748a27 commit 7baf57c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions 90-AppendixA-DataImport.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ anes_excel <-

## Importing Stata, SAS, and SPSS files into R

The {haven} package, also from the tidyverse ecosystem, imports various proprietary data formats: Stata `.dta` files, SPSS `.sav` files, and SAS `.sas7bdat` and `.sas7bcat` files [@R-haven]. One of the notable strengths of the {haven} package is its ability to handle multiple proprietary formats within a unified framework. It offers dedicated functions for each supported proprietary format, making it straightforward to import data regardless of the program. Here, we introduce `read_dat()` for Stata files, `read_sav()` for SPSS files, and `read_sas()` for SAS files.
The {haven} package, also from the tidyverse ecosystem, imports various proprietary data formats: Stata `.dta` files, SPSS `.sav` files, and SAS `.sas7bdat` and `.sas7bcat` files [@R-haven]. One of the notable strengths of the {haven} package is its ability to handle multiple proprietary formats within a unified framework. It offers dedicated functions for each supported proprietary format, making it straightforward to import data regardless of the program. Here, we introduce `read_dta()` for Stata files, `read_sav()` for SPSS files, and `read_sas()` for SAS files.

### Syntax

Let's explore the syntax for importing Stata files `.dat` files using `haven::read_dat()`:
Let's explore the syntax for importing Stata files `.dta` files using `haven::read_dta()`:

```r
read_dta(
Expand All @@ -166,7 +166,7 @@ The arguments are:
* `skip` and `n_max`: control the number of rows skipped and the maximum number of rows imported
* `.name_repair`: determines how column names are repaired if they are not valid

The syntax for `read_sav()` is similar to `read_dat()`:
The syntax for `read_sav()` is similar to `read_dta()`:

```
read_sav(
Expand Down
7 changes: 7 additions & 0 deletions 94-AppendixE-Corrections-Remarks.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Corrections & Remarks {#corrections-remarks}

These errata are in the print version. They have been corrected in the online version.

## Appendix A.3 {-}

Stata files have the extension of `.dta`. There are a few instances of using the function `read_dat()` instead of `read_dta()` on Page 315.
2 changes: 1 addition & 1 deletion _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ book_filename: bookdown
clean: [packages.bib, bookdown.bbl]
delete_merged_file: true
rmd_files:
html: ['index.Rmd', '01-introduction.Rmd', '02-overview-surveys.Rmd', '03-survey-data-documentation.Rmd', '04-set-up.Rmd', '05-descriptive-analysis.Rmd', '06-statistical-testing.Rmd', '07-modeling.Rmd', '08-communicating-results.Rmd', '09-reproducible-data.Rmd', '10-sample-designs-replicate-weights.Rmd', '11-missing-data.Rmd', '12-successful-survey-data-analysis.Rmd', '13-ncvs-vignette.Rmd', '14-ambarom-vignette.Rmd', '90-AppendixA-DataImport.Rmd', '91-AppendixB-ANES-CB.Rmd', '92-AppendixC-RECS-CB.Rmd', '93-AppendixD-Solutions.Rmd', '99-references.Rmd']
html: ['index.Rmd', '01-introduction.Rmd', '02-overview-surveys.Rmd', '03-survey-data-documentation.Rmd', '04-set-up.Rmd', '05-descriptive-analysis.Rmd', '06-statistical-testing.Rmd', '07-modeling.Rmd', '08-communicating-results.Rmd', '09-reproducible-data.Rmd', '10-sample-designs-replicate-weights.Rmd', '11-missing-data.Rmd', '12-successful-survey-data-analysis.Rmd', '13-ncvs-vignette.Rmd', '14-ambarom-vignette.Rmd', '90-AppendixA-DataImport.Rmd', '91-AppendixB-ANES-CB.Rmd', '92-AppendixC-RECS-CB.Rmd', '93-AppendixD-Solutions.Rmd', '94-AppendixE-Corrections-Remarks.Rmd', '99-references.Rmd']
latex: ['index.Rmd', '01-introduction.Rmd', '02-overview-surveys.Rmd', '03-survey-data-documentation.Rmd', '04-set-up.Rmd', '05-descriptive-analysis.Rmd', '06-statistical-testing.Rmd', '07-modeling.Rmd', '08-communicating-results.Rmd', '09-reproducible-data.Rmd', '10-sample-designs-replicate-weights.Rmd', '11-missing-data.Rmd', '12-successful-survey-data-analysis.Rmd', '13-ncvs-vignette.Rmd', '14-ambarom-vignette.Rmd', '90-AppendixA-DataImport.Rmd', '91-AppendixB-ANES-CB-latex.Rmd', '92-AppendixC-RECS-CB-latex.Rmd', '93-AppendixD-Solutions-latex.Rmd', '99-references.Rmd']
language:
label:
Expand Down

0 comments on commit 7baf57c

Please sign in to comment.