o Adapted class methods for declared objects with "Date
" inputs
o Improved function sum()
for declared objects
o Fixed bug in undeclare()
with numeric values and character (declared)
missing values (thanks to Kyle Husmann for the report)
o New methods for vec_proxy()
and vec_restore()
for objects of class
"declared
" (thanks to Kyle Husmann for the PR)
o Objects of class "Date
" are now accepted as input for a declared object
o The package no longer automatically coerces from numeric to integer
o Improved version of w_table()
for duplicated labels
o Bug fix in as.haven()
for declared missing values with no labels
(thanks to Marijana Glavica for the report)
o Maintenance work to comply with the CRAN related issues generated by the
new behavior of the base function is.atomic()
o Improved treatment of extended missing values, via imported haven objects
o w_table()
now correctly display the missing values, in the declared order
o New argument "vlabel
" in function w_table()
, to print the variable
label, if present
declared()
now recognize a "labels
" attribute of the input
object, if it already exists
measurement()
, when dealing with variables with
missing range only (no discrete missing values declared)print_as_df
" (TRUE by default)
to print the labels as a data framew_IQR()
and w_fivenum()
is.element()
, %in%
and match()
now properly recognize
declared objects
as.character.declared()
anyNAempty()
and anyNAdeclared()
rbind()
data frames, taking care of declared variables
labels()
, and the function variable_label()
has been replaced with the
function label()
as.factor()
, with values and (where available) levels
(thanks to Daniel Antal for the report)drop_na()
to drop information about the declared
missing valuesmeasurement
" in function declared()
measurement()
, to query and allocate measurement levelsvalues
" in the S3 method for as.character()
as_declared()
and as_haven()
from the namespaceas.haven()
which should return double objectsw_table()
affecting zero frequency categoriesfrtable()
from function w_table()
is.empty()
, testing the presence of undeclared missing valuesdeclare()
is now generic, allowing flexibility to create
custom methods for any other classes of objectsw_mode()
and w_standardize()
w_summary()
, summaries should not be rounded by defaultw_mean()
to weight negative values
Thanks to an anonymous reviewer for reporting and suggesting the following:drop
" in function undeclare()
head()
and tail()
as.factor()
for objects of class "declared
"as.declared()
, is.declared()
w_summary()
w_table()
and w_quantile()
now properly deal with missing weightstrim
" in function w_mean()
w_table()
, an internal object was inadvertently returned
w_mean()
, w_var()
and w_sd()
, w_quantile()
and
w_median()
, to obtain weighted versions of mean, variance and standard
deviation, quantiles and median, respectively, adapted to declared objects
as.haven.declared()
, when all values are (declared)
missing and labels are not numericweight
" changed to "wt
" in w_table()
w_table()
: "observed
" to only print observed
values, and "margin
" to calculate proportions in crosstabsw_table()
now accepts a second argument "y
" to create crosstabsfrtable()
renamed to w_table()
standing for weighted tableweight
" in function frtable()
, allowing to weight not
only valid but also missing values
frtable()
in treating declared values with
overlapping labels (e.g. hierarchical ISCO codes and categories)declared()
when all values are completely missingas.declared()
now retains the "format.spss" attribute, if existingdeclared
", to avoid a bug in
package ReadStat that prevents exporting missing values to SPSS for
integer variables