|
21 | 21 | #' For Stata 14 and later, you should not need to manually specify `encoding` |
22 | 22 | #' value unless the value was incorrectly recorded in the source file. |
23 | 23 | #' |
| 24 | +#' @section Stata versions: |
| 25 | +#' The `version` argument controls which Stata file format is used, which |
| 26 | +#' determines compatibility with different versions and flavours of Stata. |
| 27 | +#' The following table shows the supported versions: |
| 28 | +#' |
| 29 | +#' \tabular{llll}{ |
| 30 | +#' \strong{version} \tab \strong{File format} \tab \strong{Stata version} \tab \strong{Compatible flavours} \cr |
| 31 | +#' 8-9 \tab 113 \tab Stata 8-9 \tab BE, SE, MP \cr |
| 32 | +#' 10-11 \tab 114 \tab Stata 10-11 \tab BE, SE, MP \cr |
| 33 | +#' 12 \tab 115 \tab Stata 12 \tab BE, SE, MP \cr |
| 34 | +#' 13 \tab 117 \tab Stata 13 \tab BE, SE, MP \cr |
| 35 | +#' 14 \tab 118 \tab Stata 14+ \tab BE, SE, MP \cr |
| 36 | +#' 15 \tab 119 \tab Stata 15+ \tab MP only |
| 37 | +#' } |
| 38 | +#' |
| 39 | +#' In most cases you should use the default `version = 14`: |
| 40 | +#' \itemize{ |
| 41 | +#' \item Versions 8-14 create files readable by all flavours of Stata |
| 42 | +#' (Stata/BE, Stata/SE, and Stata/MP). |
| 43 | +#' \item Version 15 creates format 119 files, designed for datasets exceeding |
| 44 | +#' 32,767 variables. These files can only be opened by Stata/MP, even if |
| 45 | +#' your dataset has fewer variables. Stata/BE and Stata/SE will refuse to |
| 46 | +#' open these files with an error like "dataset too large". |
| 47 | +#' } |
| 48 | +#' |
| 49 | +#' Only use `version = 15` if you need to write a dataset with more than 32,767 |
| 50 | +#' variables and your recipients have access to Stata/MP. |
| 51 | +#' |
24 | 52 | #' @inheritParams readr::datasource |
25 | 53 | #' @inheritParams read_spss |
26 | 54 | #' @param encoding The character encoding used for the file. Generally, |
@@ -68,7 +96,8 @@ read_stata <- read_dta |
68 | 96 |
|
69 | 97 | #' @export |
70 | 98 | #' @rdname read_dta |
71 | | -#' @param version File version to use. Supports versions 8-15. |
| 99 | +#' @param version File version to use. Supports versions 8-15. See the |
| 100 | +#' "Stata versions" section below for details on compatibility. |
72 | 101 | #' @param label Dataset label to use, or `NULL`. Defaults to the value stored in |
73 | 102 | #' the "label" attribute of `data`. Must be <= 80 characters. |
74 | 103 | #' @param strl_threshold Any character vectors with a maximum length greater |
|
0 commit comments