Skip to content

Conversation

@martinctc
Copy link
Owner

@martinctc martinctc commented Jun 20, 2025

Summary

This PR prepares the surveytoolbox package for its first CRAN release.

This PR introduces a robust test suite for the surveytoolbox package using testthat, significantly improving code reliability and maintainability.

Changes

🔧 Functions Tested

Comprehensive test coverage for core package functions including:

  • any_x - Enhanced any() function with NA handling
  • as_percent - Number to percentage conversion
  • box_it - Binary variable creation with labels
  • CAGR - Compound annual growth rate calculations
  • clean_strings - Variable name cleaning
  • apply_row - Rowwise operations
  • look_up - Lookup table functionality
  • wrap_text - Text wrapping for visualizations
  • Label functions (set_varl, set_vall)
  • NPS functions (as_nps)
  • Utility functions (maxmin, create_named_list, likert_convert)

Checks

  • All R CMD checks pass
  • roxygen2::roxygenise() has been run prior to merging to ensure that .Rd and NAMESPACE files are up to date.
  • NEWS.md has been updated.

Change Type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature (incl. changes to visualizations)
  • Technical design
  • Build related changes (e.g. tests)
  • Refactoring (no functional changes, no api changes)
  • Code style update (formatting, renaming) or Documentation content changes
  • Other (please describe):

Notes

This fixes #<issue_number>

<other things, such as how to incorporate new changes>

@martinctc martinctc self-assigned this Jun 20, 2025
@martinctc martinctc marked this pull request as ready for review January 28, 2026 15:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the surveytoolbox package for its first CRAN release by adding comprehensive test coverage, two vignettes, updating documentation, and ensuring CRAN compliance.

Changes:

  • Added comprehensive test suite with testthat covering all major package functions
  • Created two vignettes: "Getting Started" and "surveytoolbox Walkthrough" providing practical examples
  • Updated function documentation with proper @return tags and improved descriptions
  • Enhanced platform-specific handling for Windows-only clipboard functions
  • Updated GitHub Actions workflow to test across multiple OS and R versions
  • Added CRAN submission files (cran-comments.md, LICENSE.md, NEWS.md)
  • Updated DESCRIPTION file with proper Authors@R format and comprehensive package description
  • Removed deprecated mutate_at calls from examples

Reviewed changes

Copilot reviewed 81 out of 82 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
DESCRIPTION Updated to CRAN-ready format with proper metadata and dependencies
NAMESPACE Added new exports and imports for new functions and dependencies
NEWS.md Documents initial CRAN release with feature list
LICENSE.md Added GPL-3 license reference
cran-comments.md CRAN submission notes documenting test environments
vignettes/surveytoolbox-walkthrough.Rmd Comprehensive walkthrough of all package functions
vignettes/getting-started.Rmd Quick start guide for common use cases
tests/testthat/test-*.R Comprehensive test suite covering all major functions
R/*.R Updated documentation with @return tags and platform checks
man/*.Rd Regenerated documentation files from updated roxygen
.github/workflows/R-CMD-check.yaml Enhanced CI workflow for multi-platform testing
README.md Removed "under development" messaging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 19
#' @param x Log-linear model to be passed through
#'
#' @return a [tibble][tibble::tibble-package]
#'
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate documentation tags found. There are two @param x tags (lines 10 and 16) and two @return tags (lines 12 and 18) in the roxygen documentation. Remove the duplicate tags at lines 16-18 to avoid roxygen2 warnings.

Suggested change
#' @param x Log-linear model to be passed through
#'
#' @return a [tibble][tibble::tibble-package]
#'

Copilot uses AI. Check for mistakes.

# NPS categories
nps_category = as_nps(nps),
# Satisfaction as percentage (for reporting)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation of comment. The comment on line 98 is not properly aligned with the code block. It should be indented at the same level as the other lines within the mutate call.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants