Skip to content

Commit

Permalink
Merge branch 'main' into rc_datawizard_1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke authored Dec 31, 2024
2 parents 88e58c8 + 08128ff commit adebd4c
Show file tree
Hide file tree
Showing 8 changed files with 681 additions and 207 deletions.
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,29 @@ BREAKING CHANGES AND DEPRECATIONS
- if `select` (previously `pattern`) is a named vector, then all elements
must be named, e.g. `c(length = "Sepal.Length", "Sepal.Width")` errors.

* Order of arguments `by` and `probability_weights` in `rescale_weights()` has
changed, because for `method = "kish"`, the `by` argument is optional.

* The name of the rescaled weights variables in `rescale_weights()` have been
renamed. `pweights_a` and `pweights_b` are now named `rescaled_weights_a`
and `rescaled_weights_b`.

* `print()` methods for `data_tabulate()` with multiple sub-tables (i.e. when
length of `by` was > 1) were revised. Now, an integrated table instead of
multiple tables is returned. Furthermore, `print_html()` did not work, which
was also fixed now.

* `demean()` (and `degroup()`) gets an `append` argument that defaults to `TRUE`,
to append the centered variabled to the original data frame, instead of
to append the centered variables to the original data frame, instead of
returning the de- and group-meaned variables only. Use `append = FALSE` to
for the previous default behaviour (i.e. only returning the newly created
variables).

CHANGES

* `rescale_weights()` gets a `method` argument, to choose method to rescale
weights. Options are `"carle"` (the default) and `"kish"`.

* The `select` argument, which is available in different functions to select
variables, can now also be a character vector with quoted variable names,
including a colon to indicate a range of several variables (e.g. `"cyl:gear"`).
Expand Down
2 changes: 1 addition & 1 deletion R/data_arrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data_arrange.default <- function(data, select = NULL, safe = TRUE) {
select <- gsub("^-", "", select)

# check for variables that are not in data
dont_exist <- select[which(!select %in% names(data))]
dont_exist <- setdiff(select, colnames(data))

if (length(dont_exist) > 0) {
if (safe) {
Expand Down
Loading

0 comments on commit adebd4c

Please sign in to comment.