surveyframe 0.4.2 is on CRAN

surveyframe
R packages
survey research
release notes
surveyframe 0.4.2 is a defect-fix release: 31 blocker defects from an external review, chiefly in data collection, scoring and statistics, are corrected.
Published

September 25, 2026

Keywords

surveyframe, CRAN, R package, bug fixes, data collection, Google Sheets, scale scoring, reproducibility

TL;DR: surveyframe 0.4.2 reached CRAN on 25 September 2026. Install it with install.packages("surveyframe"). It is a defect-fix release. An external review of 0.4.1 raised 171 findings, 31 of them blockers, and this release corrects them. The fixes that matter most are in data collection, because an answer recorded wrongly is lost for good. Free and open source under the MIT licence.

What this release is for

0.4.2 is about correctness. It makes the existing methods record, score and report exactly what they claim to. Every fix is listed in the package’s NEWS file, grouped by where it applies: collection, the researcher interface, scoring, statistics and decision analysis. The release passes 3,603 tests.

It was submitted on 25 September, failed CRAN’s automatic pre-test on 2 points (usage sections on help pages and the Windows check time), was fixed and resubmitted, and was accepted.

Collection fixes

The Shiny survey erased every answer. In render_survey(), each answer re-drew the page and the re-drawn questions reported themselves empty, so an answer was wiped about a second after it was given. Every standard-mode survey run with render_survey() in 0.4.1 and earlier was affected. Answers now stay put.

The Google Sheets collector could turn an answer into a formula. An answer beginning with = was evaluated by the spreadsheet, so =1+1 was stored as 2, and a code such as 007 lost its leading zeros. Answers are now written through the Sheets API’s RAW option, which stores them as submitted.

The exported survey claimed more than it knew. The page posts with no-cors, so the browser can confirm only that a request left. The thank-you screen now says the answers were sent and that receipt is unconfirmed, keeps the CSV download available and leaves any redirect for the participant to choose. A failed send says so and offers a retry.

Exported surveys now keep exactly what the respondent entered. A typed number is kept as typed, an option coded 0 is recorded as 0, a ranking submits the order shown, and an untouched slider, ranking or date counts as unanswered.

Long rating scales stack on a phone. An 11-point scale needed 550 pixels across, so a participant on a 390-pixel screen saw part of it with both ends off screen. Each option now becomes a labelled row.

Scoring and statistics fixes

  • Reverse coding now applies within the scale that declares it, a missing item column counts as unanswered and reports show the scores score_scales() computes.
  • Cochran’s Q now removes a respondent with a missing answer. ANCOVA now reports adjusted tests, partial correlation uses the correct degrees of freedom and the Firth likelihood-ratio statistic is reported at its full value.
  • sample_size_plan() now calculates power for t tests, ANOVA and regression from the effect size you give it.
  • Results tables report p values to 3 decimals, so .004 shows as .004.
  • Decision-analysis weights, criterion types and judgement matrices are matched by criterion name, so a ranking depends only on the values given.

What you need to change

  • Google Sheets collection needs the Sheets advanced service. Regenerate the collector with export_google_sheet(), redeploy it and add Services > Google Sheets API with the identifier Sheets in the Apps Script editor.
  • Re-run scale scores and some statistics. Analyses of reverse-coded or shared scale items, and those using the tests listed above, can give different results.
  • Some instruments that validated before are now refused. One example: an item controlled by 2 branching rules, since a rule is identified by the item it controls. validate_sframe() names each problem.
  • Shiny-collected responses now carry a respondent_id. Collect into a new CSV file so every response gets one.

Get it

The 0.4.1 release notes cover the teaching demos and labelled export this release builds on.