Debian Codegraph @

inst/NEWS.Rd

raw
1 \name{NEWS}
2 \title{\emph{memisc} News}
3 \encoding{UTF-8}
4
5 \section{Version 0.99}{
6 \subsection{NEW FEATURES}{
7 \itemize{
8 \item A new object-oriented infrastructure for the creation of HTML code
9 is used in \code{format_html()} methods. This infrastructure is exposed
10 by the \code{html()} function.
11 \item Support for with model groups in \code{mtable()}. \code{c.mtable()} now creates
12 groups of models, if arguments are tagged.
13 \item Flattened contingency tables (\code{ftable()}s as they are created
14 by the eponymous function in the \code{stats()} package) can now be
15 combined into \code{ftable_matrix()} objects. This can be done by
16 using \code{rbind()} or \code{cbind()}.
17 \item There is now an object class for survey items containing dates (without
18 times), called \code{"Date.item"}.
19 \item Support for including sandwich estimates of sampling variances and
20 standard errors into the output of \code{summary()} and \code{mtable()},
21 by the new generic functions \code{withVCov()} and
22 \code{withSE()}.
23 \item Support for different parameter sections is added to
24 \code{mtable}. This is intended to allow output of mixed
25 effects models to distinguish between ("fixed effects")
26 coefficients and variance parameters.
27 \item Objects created by \code{mtable()} also can have several
28 header lines. Facilities to add additional header lines will
29 be added soon.
30 \item Optionally, \code{mtable()} shows the left-hand sides of
31 model equations. This can be controlled by the optional
32 argument \code{show.eqnames} and by the global option
33 \code{"mtable.show.eqnames"}.
34 \item Output of \code{mtable()} objects also include, if applicable,
35 a note that explains the "significance stars" for p-values.
36 \item Summary statistics reported by \code{mtable()} can now be
37 selected for each object or object class (via calls to \code{options()})
38 separately.
39 \item It is now possible to compress the output concerning control
40 variables in \code{mtable()}.
41 \item Support for HTML and LaTeX output in Jupyter notebooks is added to objects
42 created by \code{mtable()} and \code{ftable()} etc.
43 \item The \code{toLatex()} method for "ftable" objects gains a
44 \code{fold.leaders} option (with default value \code{FALSE})
45 which allows the row labels (leaders) to remain in a single column.
46 \item A function \code{codeplan()} creates a data frame
47 describing the structure of an "importer", "data.set" or "item"
48 object. It is possible to copy this so described structure
49 from one "data.set" object to another or to a data frame.
50 \item New \code{$} and \code{[[} operators for "importer" objects
51 allow to create codebooks for single items/variables in
52 imported data files.
53 \item A \code{duplicated_labels()} function allows to show and
54 describe duplicated labels and a \code{deduplicate_labels()}
55 function allows to get rid of such duplicates.
56 \item New operators \code{\%#\%}, \code{\%##\%}, and \code{\%@\%} to
57 manipulate annotations and other attributes.
58 \item A \code{List()} function adds names to its elements by deparsing
59 arguments in the same way as \code{data.frame()} does.
60 \item A new function \code{Groups()} allows to split a data frame or a
61 "data.set" into group based on factors in a more convenient
62 way. There are methods of \code{with()} and \code{within()} to deal with
63 resulting objects of class "grouped.data". For example, the
64 \code{within()} method allows to substract group means from the
65 observations within groups. \code{withinGroups()} allows to split a
66 data frame or "data.set" objects into groups, make within-group
67 computations and recombine the groups into the order of the original
68 data frame or "data.set" object.
69 \item A new function \code{Reshape()} simplifies the syntax to reshape data frames
70 and "data.set" objects from wide into long or from long into
71 wide format.
72 \item 'tibbles', including those created with the \emph{haven}
73 package can be translated into "data.set" objects without loss
74 of information. Also "data.set" objects can be translated into
75 'tibbles' with minimal loss of information.
76 \item An extendable function \code{view()} allows to use the
77 \code{View()} facilities provided by graphical user interfaces (in
78 particular RStudio) with objects not originally supported by these
79 user interfaces. In addition, \code{view()} methods for
80 "codeplan", "decriptions", "data.set", and "inporter" are
81 provided, which allow to conviently inspect the contents of
82 these objects in RStudio.
83 \item An "as.data.table" for coercing "data.set" objects directly
84 into "data.table" objects.
85 \item It is now possible to specify the measurement level for a set
86 of variables in a "data.set" objects, either by using the
87 assignment operator with \code{measurement()} or by using
88 the new function \code{set_measurement()}.
89 \item There are convenience wrappers such as \code{Mean()} etc. for
90 \code{mean()} etc. that have the default setting \code{na.rm=TRUE}
91 instead of \code{na.rm=FALSE}.
92 \item A new \code{deduplicate_labels()} function allows to deal with
93 duplicate labels (where several codes have the same label)
94 \item It is now possible to create codebooks for weighted data.
95 \item The function \code{trim_labels()} allows to trim codes from
96 value labels.
97 \item The function \code{reverse()} allows to reorder the
98 codes of a survey item in reverse order.
99 \item The generic function \code{Means()} allows to conveniently obtain
100 group means, optionally with standard errors and/or confidence
101 intervals.
102 \item The colon operator (\code{:}) can be used to refer to ranges of
103 variables in \code{foreach()}
104 \item Code plans (objects in class "codeplan") can now be exported
105 to and imported from YAML and JSON files.
106 \item A new generic function \code{format_md()}
107 (contributed by Mael Astrud-Le Souder) allows to format R
108 objects in Markdown. Currently, methods for codebooks (and entries
109 in codebooks) are implemented.
110 \item A new generic function \code{coarsen()} allows to coarsen
111 numeric vectors into factors, based on a given number of
112 categories.
113 \item A new generic function \code{measurement_autolevel()}
114 allows to automatically select the appropriate measurement
115 level for survey items.
116 \item A new operator \code{\%if\%} allows to assign values to a variable
117 for observations that satisfy a condition.
118 \item A new operator \code{\%$$\%} allows to abbreviate
119 object modifications using \code{within()}, i.e.
120 instead of \code{a <- within(a, \{ ... \})}
121 you can write \code{a \%$$\% \{ ... \}}
122 }
123 }
124 \subsection{IMPROVEMENTS}{
125 \itemize{
126 \item Subset methods for importer objects are much more memory
127 efficient and now can handle files of size larger than 1GB.
128 \item \code{useDcolumn} and \code{useBooktabs} arguments of
129 \code{toLatex()} methods now have global options as defaults
130 \item \code{toLatex()} methods optionally escape dollar, subscript and
131 superscript symbols. This can be set either by an explicit
132 (new) argument \code{toLatex.escape.tex} or by a global option
133 with the same name.
134 \item The \code{toLatex()} method for "ftable" objects has a new
135 option \code{fold.leaders}.
136 \item \code{spss.system.file()} now translates numeric variables with any SPSS
137 date format into a "datetime.item"
138 \item The function \code{List()} adds names to the elements of the
139 resulting list in a way similar to how \code{data.frame()}
140 adds names to the columns of a data frame.
141 \item \code{Stata.file()} now handles files in format rev. 117 and
142 later as they are created by Stata version later than 13.
143 \item User definded missing values are now reported in separate
144 tables in entries created by \code{codebook()} even if these
145 entries refer to items with measurement level "interval" or
146 "ratio".
147 \item If the annotation or the labels of a non-item is set to NULL
148 this no longer causes an error.
149 \item Changing varible names to lowercase while importing data
150 sets with \code{Stata.file()}, \code{spss.portable.file()}, and
151 \code{spss.system.file()} is now optional.
152 \item Importer methods \code{Stata.file()}, \code{spss.portable.file()}, and
153 \code{spss.system.file()} now have optional arguments that
154 allow to deal with variable labels or value labels in
155 non-native encoding (e.g. \code{CP1252} on a \code{utf-8}
156 platform).
157 \item A function \code{spss.file()} acts as a common interface to
158 \code{spss.portable.file()} and \code{spss.system.file()}.
159 \item The function \code{head()} and \code{tail()} now work with
160 "data.set" and "importer" objects in the same sensible way as they
161 do with data frames.
162 \item The function \code{recode()} behaves more coherently: If a labelled
163 vector is the result of 'recode' it gets the measurement level
164 "nominal". Factor levels explictly created first come first in the order of
165 factor levels.
166 \item The function \code{spss.system.file()} now handles buggy SPSS
167 system files that lack information about the number of
168 variables in their header. (These files are typically
169 created by the library ReadStat, used e.g. by the R package
170 'haven'.)
171 \item SPSS syntax files are now converted to the encoding of
172 the host system if they have a different one. By default,
173 the original encoding is assumed to be Codepage 1252 (extended
174 Latin-1).
175 \item \code{codebook()}, \code{codeplan()}, \code{labels()},
176 \code{value.filter}, and related functions return \code{NULL}
177 for \code{NULL} arguments.
178 \item \code{codeplan()} also works with indiviual survey items and
179 can set to \code{NULL}, which means that all memisc-specific
180 information is removed from the data.
181 \item \code{codebook()} works also with data frames (or "tibbles")
182 imported with the \emph{haven} package.
183 \item \code{codebook()} now makes use of the "label" attribute of variables if the
184 attribute is present.
185 \item \code{with(Groups())}, \code{withGroups()},
186 \code{within(Groups())}, \code{withinGroups()},
187 \code{Aggregate()}, and \code{genTable()} are considerably
188 faster now. They can also make use of certain automatic
189 variables such as \code{n_}, \code{i_} that contain group
190 sizes and group indices.
191 \item \code{relabel()}, \code{rename()}, and \code{dimrename()},
192 do no longer require their arguments to be enclosed in
193 quotation marks.
194 \item Operators '$', '[', and '[[' can now be appied to codebook objects
195 to get a codebook of a subset of the varaibles.
196 \item \code{spss.system.file()} now uses information contained in SPSS
197 files (if available) to determine the measurement level
198 of the improrted variables.
199 \item \code{spss.system.file()} uses information about the character set
200 encoding if available in the file to translate variable labels and
201 value labels into the coding of the machine on which \emph{R} is
202 being run.
203 \item \code{spss.system.file()} also (optionally) uses information
204 about the intended measurement level fo variables in the file.
205 \item \code{as.item()} now drops non-unique labelled values when applied to a
206 "labelled", "haven_labelled", or "haven_labelled_spss" object.
207 \item \code{spss.system.file()} no takes into account metadata about
208 measurement levels ("nominal", "ordinal", or "scale") to set
209 the \code{measurement()} attributes of the items in
210 the resulting \code{"importer"} and \code{"data.set"}
211 objects.
212 \item \code{mtable()} now handles objects of class "clmm" (from package "ordinal")
213 and the handling of objects of class "merMod" (from package "lme4")
214 is more consistent with those of class "glm" (e.g. the number of
215 observations is shown).
216 \item Variance component estimates of "merMod" and "clmm" objects are reported
217 as distinct statistics.
218 \item \code{recode()} has a new optional argument \code{code=}. If
219 \code{TRUE}, existing codes (and labels) are retained.
220 \item \code{recode()} now allows to recode factors into numeric vectors.
221 \item If the change in codes done by \code{recode()} merely
222 reorders codes, labels are reordered accordingly, unless
223 labels are explicitly given.
224 \item \code{subset()} is S3-generic again, as this allows for lazy
225 evaluation of its arguments.
226 \item \code{cases()} handles \code{NAs} more sensibly - if a
227 case condition is \code{TRUE} this leads to a non-\code{NA}
228 result even if other conditions evaluate to \code{FALSE}, if
229 \code{cases()} is called with \code{na.rm=TRUE} (the
230 default).
231 \item The result of \code{subset} and of the bracket-operator (\code{[]})
232 applied to importer objects has row names that indicate the rows
233 selected from the full data.
234 \item A method of \code{format} for data set objects is added.
235 \item The row names of subsets fo importer objects reflect the row numbers in
236 the original data.
237 \item \code{collect.data.frame} and \code{collect.data.set} gain a
238 \code{use_last} and a \code{detailed_warnings} option
239 to improve handling of variables with different attributes
240 in different objects being collected.
241 \item \code{spss.system.file()}, \code{spss.portable.file()}, and \code{Stata.file()} get
242 an optional \code{negative2missing} argument.
243 \item \code{recode()} keeps \code{NA}s as \code{NA}s when an
244 \code{otherwise} argument is given and \code{NA}s are not
245 recoded explicitly.
246 \item \code{codebook()} now fully supports logical vectors.
247 \item HTML output created by \code{format_html} etc. now uses
248 '<style>' elements for formatting. This reduces the size of
249 created HTML code.
250 }
251 }
252 \subsection{BUGFIXES}{
253 \itemize{
254 \item \code{str} and \code{ls.str} are imported from the
255 \code{utils} package to prevent a NOTE in R CMD check
256 \item HTML tables and lists are no loger wrapped in HTML paragraphs
257 in \code{format_html.CodebookEntry}.
258 \item \code{show} and \code{codebookEntry} methods for the
259 "datetime.item" now work asexpected.
260 \item \code{cases} handles \code{NA}s more gracefully
261 \item \code{toLatex.ftable} output has been improved: No attempt at
262 showing non-existent variable names, better application of
263 \code{extracolsep}.
264 \item Duplicate value labels now produce an error if item object is
265 coerced into a factor.
266 \item A bug concerning missing values in SPSS files is fixed.
267 \item Headlines in vignettes are now coherent.
268 \item \code{mtable} with empty summary sections can be created
269 (again).
270 \item Objects returned by \code{mtable} return objects with class
271 "memisc_mtable" to avoid name clash with objects created by the
272 \code{model.table} in package "stats".
273 \item Calls to PROTECTION are added to the C-source to prevent protection
274 errors.
275 \item \code{toLatex()} now handles matrices in data frames.
276 \item \code{spss.portable.file()} now handles files with weighting
277 variables and empty variable labels.
278 \item \code{spss.fixed.file()} now handles files with lines that are
279 longer than the number of columns specified in the columns
280 definition file.
281 \item \code{spss.system.file()} now correctly imports value labels
282 of string variables.
283 \item Some PROTECTION issus in the C-source flagged by Tomas
284 Kalibera's \code{rchk} utility are fixed.
285 \item If "data.set" objects are combined and succeeding objects contain
286 "items" not contained in the preceding ones, the result now will
287 still be a valid "data.set" object.
288 \item \code{seekData} etc. no longer try to recreate external
289 pointers in order to avoid segmentation faults. Also the deletion of
290 empty pointers is avoided for the same reason.
291 \item \code{as.data.set} works for "tibbles" also when method dispatch
292 via class inheritance does not work.
293 \item \code{codebook()} now handles character variables in SPSS
294 system files correclty.
295 \item \code{codebook()} uses the appropriate logical operator in checking
296 for missings.
297 }
298 }
299 \subsection{USER-VISIBLE CHANGES}{
300 \itemize{
301 \item All vignettes are now using \emph{knitr}.
302 \item HTML output uses unicode characters by default instead of
303 amersand-escapes to enhance compatibility with \emph{pandoc}.
304 \item \code{codebook()} no longer shows the skewness and kurtosis of
305 numeric variables to save output space.
306 }
307 }
308 \subsection{DEFUNCT}{
309 \itemize{
310 \item The function \code{UnZip} has been removed from the package. \code{unzip} in conjunction with
311 \code{system.file} does the same job, as can be seen in the example for \code{spss.portable.file}.
312 }
313 }
314 }
315
316
317 \section{Version 0.98}{
318 \subsection{NEW FEATURES}{
319 \itemize{
320 \item Support for exporting results of various functions into HTML format is now
321 supported by the function \code{format_html}.
322 This should make it easier to import them into HTML or word-processing
323 documents (that support importing HTML). A preview of the HTML is made available
324 by the new (generic) function \code{show_html}.
325
326 In particular, results of the functions \code{mtable} (i.e. tables of
327 model estimates), \code{ftable} (i.e. flattened contingency tables etc.),
328 and \code{codebooks}, can be exported int. HTML using \code{format_html}.
329 Also data frames can be exported into HTML.
330
331 \item A function \code{dsView} is added, which allows a display of \code{data.set}
332 objects similar as \code{View} displays data frames.
333
334 \item \code{mtable} now handles multi-equation models better, in particular
335 if the model objects supplied as arguments vary in the number and/or names
336 of the equations. There is also a new option to place confidence intervals
337 to the right of coefficient estimates. Further \code{mtable} gains
338 the following optional aguments:
339 \itemize{
340 \item \code{show.baselevel}, which
341 allows to suppress the display of baseline categories of dummy variables,
342 when dummy variable coefficients are displayed
343 \item \code{sdigits}, to specify the number of digits of summary statistics.
344 \item \code{gs.options}, to pass optional arguments to \code{getSummary}, allowin
345 for more flexibility in creating tables.
346 }
347 One can now use a \code{summaryTemplate}
348 generic function for formatting model summaries, in addition to set the template by
349 \code{setSummaryTemplate}.
350 Finally, parts of "mtables" can be extracted using the \code{[} operator as
351 with matrices, and "mtables" can now also be concatenated.
352
353 \item There is now an object class for survey items containing dates and times, called
354 \code{"datetime.item"}
355
356 \item There is a new function \code{wild.codes} to check wild codes (i.e.
357 unlabelled codes of an otherwise labelled item.)
358
359 \item \code{codebook} now supports data frames, factors, and numeric vectors.
360
361 \item A \code{toLatex} method exists now for \code{data.set} objects, data frames and other objects.
362
363 \item A new \code{percentages} function is added to allow easy creation of tables of percentages.
364 }
365 }
366 \subsection{BUGFIXES}{
367 \itemize{
368 \item \code{spss.fixed.file} is now able to handle labelled strings and
369 \code{value labels} and \code{missing values} statements.
370 \item Internal C-code used by \code{spss.fixed.file} no longer assumed that
371 arguments are copied -- some strange behaviour of objects created by \code{spss.fixed.file}
372 is now corrected.
373 \item Description of items in external data sources is more complete now - the same
374 information as for items in internal \code{data.sets}.
375 \item \code{applyTemplate} now returns empty strings for undefined quantities.
376 \item \code{collect} method for \code{data.sets} now works as expected.
377 \item \code{spss.fixed.file} now checks whether there are undefined variables in \code{varlab.file} etc.
378
379 \item \code{Stata.file} now can import Stata 9 and Stata 10 files.
380 }
381 }
382 \subsection{USER-VISIBLE CHANGES}{
383 \itemize{
384 \item Argument \code{drop} no longer used by function \code{mtable}.
385 \item Format of file produced by \code{write.mtable} can now be
386 specified using a \code{format=} argument. But \code{forLaTeX=TRUE}
387 still can be used to get LaTeX files.
388 }
389 }
390 \subsection{DEFUNCT}{
391 \itemize{
392 \item The functions \code{Termplot}, \code{Simulate}, and \code{panel.errbars}
393 are defunct. Graphics similar to those built with \code{panel.errbars}
394 can be created with facilities provided by the package "mplot", which
395 is currently available on GitHub.
396 }
397 }
398 }
399 \section{Version 0.97 }{
400 \subsection{NEW FEATURES}{
401 \itemize{
402 \item \code{spss.system.file} and \code{spss.portable.file} gain a \code{tolower=} argument
403 that defaults to \code{TRUE}, which
404 allows to change annoying all-upper-case variable names to lower case
405 \item New generic function \code{Iconv()} that allows to change the character enconding of variable
406 descriptions and value labels. It has methods for \code{"data.set"}, \code{"importer"}, \code{"item"},
407 \code{"annotation"}, and \code{"value.label"} objects.
408 \item There is now a method of \code{as.character()} for \code{"codebook"} objects and a convenience
409 function \code{Write()} with methods for \code{"codebook"} and \code{"description"} to make it more
410 convenient to direct the output of \code{codebook()} and \code{description()} into text files.
411 \item A method for \code{"merMod"} objects of the \code{getSummary()} generic function.
412 \code{mtable()} now should be able (again) to handle estimation results produced by \code{lmer()} and \code{glmer()} from
413 package 'lme4'.
414 \item \code{recode()} handles character vectors in a more convenient way: They are converted
415 into factors with sorted unique values (after recoding) as levels.
416 }
417 }
418 \subsection{USER-VISIBLE CHANGES}{
419 \itemize{
420 \item \code{getSummary.expCoef} is renamed into \code{getSummary_expCoef}.
421 }
422 }
423 \subsection{DEFUNCT}{
424 \itemize{
425 \item S3 method \code{aggregate.formula} has been removed from the package to avoid
426 clash with method of the same name in the \code{base} package. The function \code{Aggregate}
427 can be used instead.
428 \item Removed \code{include}, \code{uninclude}, and \code{detach.sources} as these are flagged
429 as modifying the global namespace.
430 }
431 }
432 }