rk.apyramid: High-Impact Age Pyramids for RKWard

rk.apyramid provides a high-performance graphical interface for the {apyramid} package within RKWard, enhanced with Cole Nussbaumer Knaflic's "Storytelling with Data" (SWD) principles. It allows users to create publication-quality age pyramids from standard data frames, complex survey objects (survey), and srvyr (tbl_svy) objects with instant execution even on large datasets.

🚀 What's New in Version 0.1.3

What's New in Version 0.1.2

Features

Data Handling

Visualization & Layout

📦 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("devtools")
    
    local({
      require(devtools)
      install_github("AlfCano/rk.apyramid", force = TRUE)
    })
    
  3. Restart RKWard to load the new menu entries.

💻 Usage

Once installed, the plugin is organized under:

Survey -> Graphs -> Age Pyramid

  1. Select your data object (Dataframe, Survey, or srvyr).
  2. (Optional) Enter a Subset Expression (e.g., age >= 15).
  3. Select the Age variable and the Split variable (e.g., Sex).
  4. Configure Age Processing:
    • Set Bin Width (e.g., 5 years).
    • Set Start Bins at (e.g., 15) to match your subset.
  5. Configure Settings: Check "Center Pyramid" to ensure labels aren't cut off.
  6. Click Submit.

🛠️ Dependencies

This plugin relies on the following R packages:

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

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

Workaround:

  1. Download and install the latest version of R from CRAN.
  2. Open RKWard and go to the Settings menu.
  3. Run the "Installation Checker".
  4. Point RKWard to the newly installed R version.

✍️ Author & License