Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# haven (development version)

* Documentation for `read_*()` functions now more clearly explains that
labelled vectors are an intermediate representation, and points users to
`as_factor()` and `zap_labels()` when preparing imported categorical
variables for analysis (#741).

* `col_select` in the `read_*()` functions now correctly implements the
tidyselect interface. Columns will be returned in the order specified in
`col_select` and can be renamed, e.g. `col_select = c(new = old)` (#685).
Expand Down
7 changes: 7 additions & 0 deletions R/haven-sas.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
#' Variable labels are stored in the "label" attribute of each variable. It is
#' not printed on the console, but the RStudio viewer will show it.
#'
#' Value labels from a catalog file are preserved with the [labelled()] class.
#' Labelled vectors are an intermediate representation that preserves the
#' original value labels, not a regular R factor. Convert labelled categorical
#' variables with [as_factor()], or remove value labels with [zap_labels()] if
#' you need plain R vectors for analysis. See `vignette("semantics")` for more
#' details.
#'
#' @export
#' @examples
#' path <- system.file("examples", "iris.sas7bdat", package = "haven")
Expand Down
7 changes: 7 additions & 0 deletions R/haven-spss.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
#' Variable labels are stored in the "label" attribute of each variable.
#' It is not printed on the console, but the RStudio viewer will show it.
#'
#' Value labels are preserved with the [labelled()] class, or
#' [labelled_spss()] when `user_na = TRUE`. Labelled vectors are an
#' intermediate representation that preserves the original value labels, not a
#' regular R factor. Convert labelled categorical variables with [as_factor()],
#' or remove value labels with [zap_labels()] if you need plain R vectors for
#' analysis. See `vignette("semantics")` for more details.
#'
#' `write_sav()` returns the input `data` invisibly.
#' @name read_spss
#' @examples
Expand Down
6 changes: 6 additions & 0 deletions R/haven-stata.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
#' Variable labels are stored in the "label" attribute of each variable.
#' It is not printed on the console, but the RStudio viewer will show it.
#'
#' Value labels are preserved with the [labelled()] class. Labelled vectors are
#' an intermediate representation that preserves the original value labels,
#' not a regular R factor. Convert labelled categorical variables with
#' [as_factor()], or remove value labels with [zap_labels()] if you need plain
#' R vectors for analysis. See `vignette("semantics")` for more details.
#'
#' If a dataset label is defined in Stata, it will stored in the "label"
#' attribute of the tibble.
#'
Expand Down
6 changes: 6 additions & 0 deletions man/read_dta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/read_sas.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/read_spss.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading