rk.survey.wrangling: Tidy Manipulation of Complex Surveys

rk.survey.wrangling extends RKWard's capabilities to handle complex survey designs (svydesign objects). It leverages the {srvyr} package to apply modern, "tidy" manipulation verbs (like mutate, group_by, and across) to survey data while automatically preserving sampling weights, stratification, and variance estimation parameters.


πŸš€ What's New in Version 0.1.5

πŸš€ What's New in Version 0.1.4

This release significantly expands the transformation capabilities and fixes critical metadata bugs:

πŸš€ What's New in Version 0.1.3

✨ Features

1. Survey Batch Transform

Apply functions to multiple variables within a design object simultaneously.

2. Survey Batch Recode

A spreadsheet-like interface for recoding variables inside a design.

3. Survey Composite Score

Calculate new variables based on row-wise aggregation of items.

🌍 Internationalization

The interface is fully localized in:

βš™οΈ Prerequisites

You must have RKWard installed along with the following R packages. The plugin will automatically attempt to load them when required:

install.packages(c("srvyr", "survey", "dplyr"))

πŸ“¦ Installation

This plugin is not yet on CRAN. To install it, use the remotes or devtools package in RKWard.

  1. Open RKWard.

  2. Run the following command in the R Console:

    # If you don't have devtools installed:
    # install.packages("remotes")
    
    local({
      require(remotes)
      install_github("AlfCano/rk.survey.wrangling", force = TRUE)
    })
    
  3. Restart RKWard to load the new menu entries.


πŸ› οΈ Usage Workflow

This plugin adds a comprehensive suite of tools under the Survey > Survey Wrangling menu in RKWard:

1. Survey Batch Transform

Apply single functions across multiple survey variables.

2. Survey Batch Recode

The ultimate tool for cleaning demographic data (e.g., standardizing "Missing" values to NA).

3. Survey Composite Score

Aggregate multiple items (like Likert scale questions) into a single analytical score.


Troubleshooting: Errors installing devtools or missing binary dependencies (Windows)

If you encounter errors mentioning "non-zero exit status", "namespace is already loaded", or requirements for compilation (compiling from source) when installing packages, it is likely because the R version bundled with RKWard is older than the current CRAN standard.

Workaround: Until a new, more recent version of R (current bundled version is 4.3.3) is packaged into the RKWard executable, these issues will persist. To fix this:

  1. Download and install the latest version of R (e.g., 4.5.2 or newer) from CRAN.
  2. Open RKWard and go to the Settings (or Preferences) menu.
  3. Run the "Installation Checker".
  4. Point RKWard to the newly installed R version.

This "two-step" setup (similar to how RStudio operates) ensures you have access to the latest pre-compiled binaries, avoiding the need for RTools and manual compilation.

✍️ Author & License