\name{NEWS} \title{\emph{memisc} News} \encoding{UTF-8} \section{Version 0.99}{ \subsection{NEW FEATURES}{ \itemize{ \item A new object-oriented infrastructure for the creation of HTML code is used in \code{format_html()} methods. This infrastructure is exposed by the \code{html()} function. \item Support for with model groups in \code{mtable()}. \code{c.mtable()} now creates groups of models, if arguments are tagged. \item Flattened contingency tables (\code{ftable()}s as they are created by the eponymous function in the \code{stats()} package) can now be combined into \code{ftable_matrix()} objects. This can be done by using \code{rbind()} or \code{cbind()}. \item There is now an object class for survey items containing dates (without times), called \code{"Date.item"}. \item Support for including sandwich estimates of sampling variances and standard errors into the output of \code{summary()} and \code{mtable()}, by the new generic functions \code{withVCov()} and \code{withSE()}. \item Support for different parameter sections is added to \code{mtable}. This is intended to allow output of mixed effects models to distinguish between ("fixed effects") coefficients and variance parameters. \item Objects created by \code{mtable()} also can have several header lines. Facilities to add additional header lines will be added soon. \item Optionally, \code{mtable()} shows the left-hand sides of model equations. This can be controlled by the optional argument \code{show.eqnames} and by the global option \code{"mtable.show.eqnames"}. \item Output of \code{mtable()} objects also include, if applicable, a note that explains the "significance stars" for p-values. \item Summary statistics reported by \code{mtable()} can now be selected for each object or object class (via calls to \code{options()}) separately. \item It is now possible to compress the output concerning control variables in \code{mtable()}. \item Support for HTML and LaTeX output in Jupyter notebooks is added to objects created by \code{mtable()} and \code{ftable()} etc. \item The \code{toLatex()} method for "ftable" objects gains a \code{fold.leaders} option (with default value \code{FALSE}) which allows the row labels (leaders) to remain in a single column. \item A function \code{codeplan()} creates a data frame describing the structure of an "importer", "data.set" or "item" object. It is possible to copy this so described structure from one "data.set" object to another or to a data frame. \item New \code{$} and \code{[[} operators for "importer" objects allow to create codebooks for single items/variables in imported data files. \item A \code{duplicated_labels()} function allows to show and describe duplicated labels and a \code{deduplicate_labels()} function allows to get rid of such duplicates. \item New operators \code{\%#\%}, \code{\%##\%}, and \code{\%@\%} to manipulate annotations and other attributes. \item A \code{List()} function adds names to its elements by deparsing arguments in the same way as \code{data.frame()} does. \item A new function \code{Groups()} allows to split a data frame or a "data.set" into group based on factors in a more convenient way. There are methods of \code{with()} and \code{within()} to deal with resulting objects of class "grouped.data". For example, the \code{within()} method allows to substract group means from the observations within groups. \code{withinGroups()} allows to split a data frame or "data.set" objects into groups, make within-group computations and recombine the groups into the order of the original data frame or "data.set" object. \item A new function \code{Reshape()} simplifies the syntax to reshape data frames and "data.set" objects from wide into long or from long into wide format. \item 'tibbles', including those created with the \emph{haven} package can be translated into "data.set" objects without loss of information. Also "data.set" objects can be translated into 'tibbles' with minimal loss of information. \item An extendable function \code{view()} allows to use the \code{View()} facilities provided by graphical user interfaces (in particular RStudio) with objects not originally supported by these user interfaces. In addition, \code{view()} methods for "codeplan", "decriptions", "data.set", and "inporter" are provided, which allow to conviently inspect the contents of these objects in RStudio. \item An "as.data.table" for coercing "data.set" objects directly into "data.table" objects. \item It is now possible to specify the measurement level for a set of variables in a "data.set" objects, either by using the assignment operator with \code{measurement()} or by using the new function \code{set_measurement()}. \item There are convenience wrappers such as \code{Mean()} etc. for \code{mean()} etc. that have the default setting \code{na.rm=TRUE} instead of \code{na.rm=FALSE}. \item A new \code{deduplicate_labels()} function allows to deal with duplicate labels (where several codes have the same label) \item It is now possible to create codebooks for weighted data. \item The function \code{trim_labels()} allows to trim codes from value labels. \item The function \code{reverse()} allows to reorder the codes of a survey item in reverse order. \item The generic function \code{Means()} allows to conveniently obtain group means, optionally with standard errors and/or confidence intervals. \item The colon operator (\code{:}) can be used to refer to ranges of variables in \code{foreach()} \item Code plans (objects in class "codeplan") can now be exported to and imported from YAML and JSON files. \item A new generic function \code{format_md()} (contributed by Mael Astrud-Le Souder) allows to format R objects in Markdown. Currently, methods for codebooks (and entries in codebooks) are implemented. \item A new generic function \code{coarsen()} allows to coarsen numeric vectors into factors, based on a given number of categories. \item A new generic function \code{measurement_autolevel()} allows to automatically select the appropriate measurement level for survey items. \item A new operator \code{\%if\%} allows to assign values to a variable for observations that satisfy a condition. \item A new operator \code{\%$$\%} allows to abbreviate object modifications using \code{within()}, i.e. instead of \code{a <- within(a, \{ ... \})} you can write \code{a \%$$\% \{ ... \}} } } \subsection{IMPROVEMENTS}{ \itemize{ \item Subset methods for importer objects are much more memory efficient and now can handle files of size larger than 1GB. \item \code{useDcolumn} and \code{useBooktabs} arguments of \code{toLatex()} methods now have global options as defaults \item \code{toLatex()} methods optionally escape dollar, subscript and superscript symbols. This can be set either by an explicit (new) argument \code{toLatex.escape.tex} or by a global option with the same name. \item The \code{toLatex()} method for "ftable" objects has a new option \code{fold.leaders}. \item \code{spss.system.file()} now translates numeric variables with any SPSS date format into a "datetime.item" \item The function \code{List()} adds names to the elements of the resulting list in a way similar to how \code{data.frame()} adds names to the columns of a data frame. \item \code{Stata.file()} now handles files in format rev. 117 and later as they are created by Stata version later than 13. \item User definded missing values are now reported in separate tables in entries created by \code{codebook()} even if these entries refer to items with measurement level "interval" or "ratio". \item If the annotation or the labels of a non-item is set to NULL this no longer causes an error. \item Changing varible names to lowercase while importing data sets with \code{Stata.file()}, \code{spss.portable.file()}, and \code{spss.system.file()} is now optional. \item Importer methods \code{Stata.file()}, \code{spss.portable.file()}, and \code{spss.system.file()} now have optional arguments that allow to deal with variable labels or value labels in non-native encoding (e.g. \code{CP1252} on a \code{utf-8} platform). \item A function \code{spss.file()} acts as a common interface to \code{spss.portable.file()} and \code{spss.system.file()}. \item The function \code{head()} and \code{tail()} now work with "data.set" and "importer" objects in the same sensible way as they do with data frames. \item The function \code{recode()} behaves more coherently: If a labelled vector is the result of 'recode' it gets the measurement level "nominal". Factor levels explictly created first come first in the order of factor levels. \item The function \code{spss.system.file()} now handles buggy SPSS system files that lack information about the number of variables in their header. (These files are typically created by the library ReadStat, used e.g. by the R package 'haven'.) \item SPSS syntax files are now converted to the encoding of the host system if they have a different one. By default, the original encoding is assumed to be Codepage 1252 (extended Latin-1). \item \code{codebook()}, \code{codeplan()}, \code{labels()}, \code{value.filter}, and related functions return \code{NULL} for \code{NULL} arguments. \item \code{codeplan()} also works with indiviual survey items and can set to \code{NULL}, which means that all memisc-specific information is removed from the data. \item \code{codebook()} works also with data frames (or "tibbles") imported with the \emph{haven} package. \item \code{codebook()} now makes use of the "label" attribute of variables if the attribute is present. \item \code{with(Groups())}, \code{withGroups()}, \code{within(Groups())}, \code{withinGroups()}, \code{Aggregate()}, and \code{genTable()} are considerably faster now. They can also make use of certain automatic variables such as \code{n_}, \code{i_} that contain group sizes and group indices. \item \code{relabel()}, \code{rename()}, and \code{dimrename()}, do no longer require their arguments to be enclosed in quotation marks. \item Operators '$', '[', and '[[' can now be appied to codebook objects to get a codebook of a subset of the varaibles. \item \code{spss.system.file()} now uses information contained in SPSS files (if available) to determine the measurement level of the improrted variables. \item \code{spss.system.file()} uses information about the character set encoding if available in the file to translate variable labels and value labels into the coding of the machine on which \emph{R} is being run. \item \code{spss.system.file()} also (optionally) uses information about the intended measurement level fo variables in the file. \item \code{as.item()} now drops non-unique labelled values when applied to a "labelled", "haven_labelled", or "haven_labelled_spss" object. \item \code{spss.system.file()} no takes into account metadata about measurement levels ("nominal", "ordinal", or "scale") to set the \code{measurement()} attributes of the items in the resulting \code{"importer"} and \code{"data.set"} objects. \item \code{mtable()} now handles objects of class "clmm" (from package "ordinal") and the handling of objects of class "merMod" (from package "lme4") is more consistent with those of class "glm" (e.g. the number of observations is shown). \item Variance component estimates of "merMod" and "clmm" objects are reported as distinct statistics. \item \code{recode()} has a new optional argument \code{code=}. If \code{TRUE}, existing codes (and labels) are retained. \item \code{recode()} now allows to recode factors into numeric vectors. \item If the change in codes done by \code{recode()} merely reorders codes, labels are reordered accordingly, unless labels are explicitly given. \item \code{subset()} is S3-generic again, as this allows for lazy evaluation of its arguments. \item \code{cases()} handles \code{NAs} more sensibly - if a case condition is \code{TRUE} this leads to a non-\code{NA} result even if other conditions evaluate to \code{FALSE}, if \code{cases()} is called with \code{na.rm=TRUE} (the default). \item The result of \code{subset} and of the bracket-operator (\code{[]}) applied to importer objects has row names that indicate the rows selected from the full data. \item A method of \code{format} for data set objects is added. \item The row names of subsets fo importer objects reflect the row numbers in the original data. \item \code{collect.data.frame} and \code{collect.data.set} gain a \code{use_last} and a \code{detailed_warnings} option to improve handling of variables with different attributes in different objects being collected. \item \code{spss.system.file()}, \code{spss.portable.file()}, and \code{Stata.file()} get an optional \code{negative2missing} argument. \item \code{recode()} keeps \code{NA}s as \code{NA}s when an \code{otherwise} argument is given and \code{NA}s are not recoded explicitly. \item \code{codebook()} now fully supports logical vectors. \item HTML output created by \code{format_html} etc. now uses '