File: NEWS.md

package info (click to toggle)
r-cran-haven 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,164 kB
  • sloc: ansic: 22,714; cpp: 1,001; makefile: 2
file content (306 lines) | stat: -rw-r--r-- 12,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# haven 2.1.0

## Improved labelling

`labelled` objects get pretty printing that shows the labels and NA values when inside of a `tbl_df`. Turn this behaviour off with behavior using `option(haven.show_pillar_labels = FALSE)` (#340, @gergness).

`labelled()` and `labelled_spss()` now allow `NULL` labels. This makes both classes more flexible, allowing you to use them for their other attributes (#219).

`labelled()` tests that value labels are unique (@larmarange, #364)

## Minor improvements and bug fixes

*   `as_factor()`:

    * Is faster when input doesn't contain any missing values (@hughparsonage).
    * Added `labelled` method for backward compatbility (#414).
    * `data.frame` method now correctly passes `...` along (#407, @zkamvar).

*   `write_dta()` now checks that the labelled values are integers, not the 
    values themselves (#401).

*   Updated to latest ReadStat from @evanmiller:

    * `read_por()` can now read files from SPSS 25 (#412)
    * `read_por()` used base-10 instead of base-30 for the exponent (#413)
    * `read_sas()` can read zero column file (#420)
    * `read_sav()` reads long strings (#381)
    * `read_sav()` has greater memory limit allowing it to read more labels (#418)
    * `read_spss()` reads long variable labels (#422)
    * `write_sav()` creates incorrect column names when >10k columns (#410)
    * `write_sav()` no longer crashes when writing long label names (#395)
  
# haven 2.0.0R

## BREAKING CHANGES

*   `labelled()` and `labelled_spss()` now produce objects with class
    "haven_labelled" and "haven_labelled_spss". Previously, the "labelled"
    class name clashed with the labelled class defined by Hmisc (#329).
    
    Unfortunately I couldn't come up with a way to fix this problem except
    to change the class name; it seems reasonable that haven should be the one 
    to change names given that Hmisc has been around much longer. This
    will require some changes to packages that use haven, but shouldn't
    affect user code.

## Minor improvements

* `labelled()` and `labelled_spss()` now support adding the `label`
  attribute to the resulting object. The `label` is a short,
  human-readable description of the object, and is now also used
  when printing, and can be easily removed using the new `zap_label()`
  function. (#362, @huftis)
  
  Previously, the `label` attribute was supported both when reading
  and writing SPSS files, but it was not possible to actually create
  objects in R having the `label` attribute using the constructors
  `labelled()` or `labelled_spss()`.

# haven 1.1.2

* haven can read and write non-ASCII paths in R 3.5 (#371).

* `labelled_spss` objects preserve their attributes when subsetted 
  (#360, @gergness).

* `read_sav()` gains an `encoding` argument to override the encoding stored in 
  the file (#305). `read_sav()` can now read `.zsav` files (#338). 
  
* `write_*()` functions now invisibly return the input data frame 
  (as documented) (#349, @austensen).

* `write_dta()` allows non-ASCII variable labels for version 14 and above 
  (#383). It also uses a less strict check for integers so that a 
  labelled double containing only integer values can written (#343).

* `write_sav()` produces `.zsav` files when `compress = TRUE` (#338).

* `write_xpt()` can now set the "member" name, which defaults to the file name
  san extension (#328).

* Update to latest readstat.

  * Fixes out of memory error (#342)
  * Now supports reading and writing stata 15 files (#339)
  * Negative integer labelled values were tagged as missing (#367)

* Fix for when `as_factor()` with option `levels="labels"` is used on tagged NAs
  (#340, @gergness)

# haven 1.1.1

* Update to latest readstat. Includes:

  * SPSS: empty charater columns now read as character (#311)
  * SPSS: now write long strings (#266)
  * Stata: reorder labelled vectors on write (#327)
  * State: `encoding` now affects value labels (#325)
  * SAS: can now write wide/long rows (#272, #335).
  * SAS: can now handle Windows Vietnamese character set (#336)

* `read_por()` and `read_xpt()` now correctly preserve attributes if
  output needs to be reallocated (which is typical behaviour) (#313)

* `read_sas()` recognises date/times format with trailing separator and width
  specifications (#324)
  
* `read_sas()` gains a `catalog_encoding` argument so you can independently
  specify encoding of data and catalog (#312)

* `write_*()` correctly measures lengths of non-ASCII labels (#258): this
  fixes the cryptic error "A provided string value was longer than the 
  available storage size of the specified column."

* `write_dta()` now checks for bad labels in all columns, not just the first
  (#326).

* `write_sav()` no longer fails on empty factors or factors with an `NA`
  level (#301) and writes out more metadata for `labelled_spss` vectors 
  (#334).
 
# haven 1.1.0

* Update to latest readstat. Includes:

  * SAS: support Win baltic code page (#231)
  * SAS: better error messages instead of crashes (#234, #270)
  * SAS: fix "unable to read error" (#271)
  * SPSS: support uppercase time stamps (#230)
  * SPSS: fixes for 252-255 byte strings (#226)
  * SPSS: fixes for 0 byte strings (#245)

* Share `as_factor()` with forcats package (#256)

* `read_sav()` once again correctly returns system defined missings 
  as `NA` (rather than `NaN`) (#223). `read_sav()` and `write_sav()` preserve 
  SPSS's display widths (@ecortens).

* `read_sas()` gains experimental `cols_only` argument to only read in 
  specified columns (#248).

* tibbles are created with `tibble::as_tibble()`, rather than by "hand" (#229).

* `write_sav()` checks that factors don't have levels with >120 
  characters (#262)

* `write_dta()` no longer checks that all value labels are at most 32 
  characters (since this is not a restriction of dta files) (#239).

* All write methds now check that you're trying to write a data frame (#287).

* Add support for reading (`read_xpt()`) and writing (`write_xpt()`) SAS 
  transport files.

* `write_*` functions turn ordered factors into labelled vectors (#285)

# haven 1.0.0

* The ReadStat library is stored in a subdirectory of `src` (#209, @krlmlr).

* Import tibble so that tibbles are printed consistently (#154, @krlmlr).

* Update to latest ReadStat (#65). Includes: 

    * Support for binary (aka Ross) compression for SAS (#31).
    * Support extended ASCII encoding for Stata (#71).
    * Support for Stata 14 files (#75, #212).
    * Support for SPSS value labels with more than 8 characters (#157).
    * More likely to get an error when attempting to create an invalid
      output file (#171).

* Added support for reading and writing variable formats. Similarly to 
  to variable labels, formats are stored as an attribute on the vector.
  Use `zap_formats()` if you want to remove these attributes.
  (@gorcha, #119, #123).
  
* Added support for reading file "label" and "notes". These are not currently
  printed, but are stored in the attributes if you need to access them (#186).
  
* Added support for "tagged" missing values (in Stata these are called 
  "extended" and in SAS these are called "special") which carry an extra
  byte of information: a character label from "a" to "z". The downside of
  this change is that all integer columns are now converted to doubles, 
  to support the encoding of the tag in the payload of a NaN.
  
* New `labelled_spss()` is a subclass of `labelled()` that can model
  user missing values from SPSS. These can either be a set of distinct
  values, or for numeric vectors, a range. `zap_labels()` strips labels,
  and replaces user-defined missing values with `NA`. New `zap_missing()`
  just replaces user-defined missing vlaues with `NA`. 
  
    `labelled_spss()` is potentially dangerous to work with in R because
    base functions don't know about `labelled_spss()` functions so will 
    return the wrong result in the presence of user-defined missing values.
    For this reason, they will only be created by `read_spss()` when
    `user_na = TRUE` (normally user-defined missings are converted to
    NA). 

* `as_factor()` no longer drops the `label` attribute (variable label) when
   used (#177, @itsdalmo).

* Using `as_factor()` with `levels = "default` or `levels = "both"` preserves
  unused labels (implicit missing) when converting (#172, @itsdalmo). Labels 
  (and the resulting factor levels) are always sorted by values.

* `as_factor()` gains a new `levels = "default"` mechanism. This uses the
  labels where present, and otherwise uses the labels. This is now the
  default, as it seems to map better to the semantics of labelled values
  in other statistical packages (#81). You can also use `levels = "both"`
  to combine the value and the label into a single string (#82). It also
  gains a method for data frames, so you can easily convert every labelled
  column to a factor in one function call.

* New `vignette("semantics", package = "haven")` discusses the semantics
  of missing values and labelling in SAS, SPSS, and Stata, and how they
  are translated into R.

* Support for `hms()` has been moved into the hms package (#162).
  Time varibles now have class `c("hms", "difftime")` and a `units` attribute
  with value "secs" (#162).

* `labelled()` is less strict with its checks: you can mix double and integer
  value and labels (#86, #110, @lionel-), and `is.labelled()` is now exported 
  (#124). Putting a labelled vector in a data frame now generates the correct
  column name (#193).

* `read_dta()` now recognises "%d" and custom date types (#80, #130).
  It also gains an encoding parameter which you can use to override
  the default encoding. This is particularly useful for Stata 13 and below
  which did not store the encoding used in the file (#163). 

* `read_por()` now actually works (#35).

* `read_sav()` now correctly recognises EDATE and JDATE formats as dates (#72).
  Variables with format DATE, ADATE, EDATE, JDATE or SDATE are imported as 
  `Date` variables instead of `POSIXct`. You can now set `user_na = TRUE` to 
  preserve user defined missing values: they will be given class 
  `labelled_spss`.

* `read_dta()`, `read_sas()`, and `read_sav()` have a better test for missing
  string values (#79). They can all read from connections and compressed files
  (@lionel-, #109)

* `read_sas()` gains an encoding parameter to overide the encoding stored
  in the file if it is incorrect (#176). It gets better argument names (#214).

* Added `type_sum()` method for labelled objects so they print nicely in
  tibbles.

* `write_dta()` now verifies that variable names are valid Stata variables
  (#132), and throws an error if you attempt to save a labelled vector that
  is not an integer (#144). You can choose which `version` of Stata's file 
  format to output (#217).

* New `write_sas()` allows you to write data frames out to `sas7bdat` 
  files. This is still somewhat experimental.

* `write_sav()` writes hms variables to SPSS time variables, and the
  "measure" type is set for each variable (#133).

* `write_dta()` and `write_sav()` support writing date and date/times
  (#25, #139, #145). Labelled values are always converted to UTF-8 before 
  being written out (#87). Infinite values are now converted to missing values 
  since SPSS and Stata don't support them (#149). Both use a better test 
  for missing values (#70).
  
* `zap_labels()` has been completely overhauled. It now works 
  (@markriseley, #69), and only drops label attributes; it no longer replaces
  labelled values with `NA`s. It also gains a data frame method that zaps
  the labels from every column.
  
* `print.labelled()` and `print.labelled_spss()` now display the type.

# haven 0.2.0

* fixed a bug in `as_factor.labelled`, which generated <NA>'s and wrong 
  labels for integer labels.

* `zap_labels()` now leaves unlabelled vectors unchanged, making it easier
  to apply to all columns.

* `write_dta()` and `write_sav()` take more care to always write output as
  UTF-8 (#36)

* `write_dta()` and `write_sav()` won't crash if you give them invalid paths,
  and you can now use `~` to refer to your home directory (#37).

* Byte variables are now correctly read into integers (not strings, #45), 
  and missing values are captured correctly (#43).

* Added `read_stata()` as alias to `read_dta()` (#52).

* `read_spss()` uses extension to automatically choose between `read_sav()`
  and `read_por()` (#53)

* Updates from ReadStat. Including fixes for various parsing bugs, more 
  encodings, and better support for large files.

* hms objects deal better with missings when printing.

* Fixed bug causing labels for numeric variables to be read in as
  integers and associated error: ``Error: `x` and `labels` must be same type``

# haven 0.1.1

* Fixed memory initialisation problems found by valgrind.