Package: formr 1.2.0

Ruben Arslan

formr: Companion R Package for the 'formr' Survey Framework

Serves as a companion toolkit for the 'formr' survey framework (<https://rforms.org>). The package acts as a bridge between a 'formr' server and a local R environment. Key features include an API client for fetching, type-casting, and automatically scoring data; a project management workflow for syncing study assets (surveys, CSS) for local editing; and functions for use within 'formr' runs to generate dynamic, personalized feedback plots and to simplify survey logic.

Authors:Ruben Arslan [aut, cre], Tim B Seidel [aut, ctb]

formr_1.2.0.tar.gz
formr_1.2.0.zip(r-4.7-any)formr_1.2.0.zip(r-4.6-any)formr_1.2.0.zip(r-4.5-any)
formr_1.2.0.tgz(r-4.6-any)formr_1.2.0.tgz(r-4.5-any)
formr_1.2.0.tar.gz(r-4.7-any)formr_1.2.0.tar.gz(r-4.6-any)
formr_1.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
formr/json (API)

# Install 'formr' in R:
install.packages('formr', repos = c('https://rforms.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/rubenarslan/formr/issues

Pkgdown/docs site:https://rubenarslan.github.io

On CRAN:

Conda:

convenience-functionsformrsurvey-framework

8.79 score 59 stars 131 scripts 375 downloads 99 exports 69 dependencies

Last updated from:ffbfe56cb1. Checks:9 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK249
source / vignettesOK274
linux-release-x86_64OK249
macos-release-arm64OK148
macos-oldrel-arm64OK130
windows-develOK98
windows-releaseOK116
windows-oldrelOK123
wasm-releaseOK142

Exports:.formr%>%%begins_with%%contains_word%%contains%%ends_with%%starts_with%aggregate_and_document_scaleasis_knit_childchoice_labels_for_valuescurrentemail_imageexpiredfeedback_chunkfinishedfirstformr_aggregateformr_api_aggregateformr_api_authenticateformr_api_backup_runformr_api_create_runformr_api_create_sessionformr_api_delete_all_filesformr_api_delete_fileformr_api_delete_runformr_api_delete_surveyformr_api_fetch_resultsformr_api_filesformr_api_is_authenticatedformr_api_logoutformr_api_pull_projectformr_api_push_projectformr_api_recogniseformr_api_resultsformr_api_reverseformr_api_run_settingsformr_api_run_structureformr_api_runsformr_api_sessionformr_api_session_actionformr_api_sessionsformr_api_survey_structureformr_api_surveysformr_api_token_expiryformr_api_unit_sessionsformr_api_upload_fileformr_api_upload_surveyformr_backup_filesformr_backup_studyformr_backup_surveysformr_connectformr_default_dirformr_disconnectformr_inline_renderformr_item_displaysformr_itemsformr_knitformr_last_hostformr_overview_sankeyformr_post_process_resultsformr_raw_resultsformr_recogniseformr_renderformr_render_commonmarkformr_resultsformr_reverseformr_run_structureformr_shuffledformr_simulate_from_itemsformr_store_keysformr_upload_itemsformr_uploaded_filesformr_user_detailformr_user_overviewget_opencpu_rdsif_naif_na_nullifelsenain_time_windowitemitemsknit_prefixedlastmarkdown_custom_optionsmarkdown_githubmarkdown_hard_line_breaksnext_daypaste.knit_asisqplot_on_barqplot_on_normalqplot_on_polarrender_textrescue_attributesreverse_labelled_valuestext_message_clickatelltext_message_massenversandtext_message_twiliotime_passedword_document

Dependencies:askpassbase64encbitbit64bslibcachemclicliprcpp11crayoncurldigestdplyrevaluatefarverfastmapfontawesomeforcatsfsgenericsggplot2gluegtablehavenhighrhmshtmltoolshttrisobandjquerylibjsonliteknitrlabelinglifecyclelubridatemagrittrmemoisemimeopensslpillarpkgconfigprettyunitsprogresspurrrR6rappdirsRColorBrewerreadrrlangrmarkdownS7sassscalesstringistringrsystibbletidyrtidyselecttimechangetinytextzdbutf8vctrsviridisLitevroomwithrxfunyaml

Fetch & Process Results
1. Authentication | 2. The One-Stop Solution (formr_api_results) | What does formr_api_results do by default? | Customizing the Fetch | 3. Advanced: The Manual Pipeline | B. Reverse Coding (formr_api_reverse) | C. Aggregation (formr_api_aggregate) | 4. Full Workflow Example | 5. Troubleshooting | "My scale isn't calculating!"

Last update: 2026-06-03
Started: 2026-05-23

Getting Started
Installation | The "Two Ways of Connecting" | Authentication | 1. Local Setup (One-time) | 1.1 Save your API Credentials | 1.2 Save your regular User Credentials (Classic) | 2. Authenticating in Scripts | 2.1 Thru the API | 2.2 With your User Credentials (Classic) | 3. Authenticating Inside formr Runs | Workflow Examples | Project Management (Push & Pull) | Fetching Results | Token Management & Security

Last update: 2026-06-03
Started: 2026-05-23

Manage your Files
Listing Files | Uploading Files | Single File | Multiple Files or Directories | Deleting Files | Cleaning Up (Delete All)

Last update: 2026-06-03
Started: 2026-05-23

Manage your Projects
Prerequisites | Backing up a Study | The Local Development Workflow | 1. Initialize (Pull) | 2. Edit | 3. Push | Watch Mode | Managing Run Settings | Advanced: Run Structure (JSON)

Last update: 2026-06-03
Started: 2026-05-23

Manage your Runs
Listing Your Runs | Creating a New Run | Configuring Run Settings | Managing Run Structure (JSON) | Exporting Structure | Importing Structure | Deleting a Run

Last update: 2026-06-03
Started: 2026-05-23

Manage your Sessions
Listing Sessions | Filter by Status | Pagination | Find Specific Participants | Creating Sessions | Controlling Sessions (Actions) | Use Case 1: Unsticking a User (Move Position) | Use Case 2: Cleaning Data (Toggle Testing) | Use Case 3: Ending Sessions

Last update: 2026-06-03
Started: 2026-05-23

Manage your Surveys
Listing Your Surveys | Inspecting and Downloading Surveys | Inspect Items in R | Download Survey Source (.xlsx) | Uploading or Updating a Survey | Google Sheets | Deleting a Survey

Last update: 2026-06-03
Started: 2026-05-23

Running R Inside Your formr Study
1. Why Run R Inside Your Study? | 2. Where the API Code Goes | A. Calculate Items (API Entry Point) | B. Inline R in Labels (Display + Fetch) | C. Inline R in Choices (Display) | 3. Your Toolkit | Authentication | Run Context | Fetching Data from Other Surveys | The current() Shorthand | 4. Walkthrough: Participant Counter | Run Structure | Calculate: participant_count | Survey: welcome | 5. Walkthrough: Real-Time Group Norms | Survey: feedback (label) | 6. Walkthrough: Dynamic Group Balancing | Calculate: pick_condition | Showif conditions | 7. Walkthrough: Synchronising with a Waiting Room | Participant experience | 8. Patterns for Robust Code | Next Steps

Last update: 2026-06-03
Started: 2026-05-23

Readme and manuals

Help Manual

Help pageTopics
Per-request environment populated by rforms.org.formr
check whether a character string begins with a string%begins_with% %starts_with%
check whether a character string contains another as a word%contains_word%
check whether a character string contains another%contains%
check whether a character string ends with a string%ends_with%
Aggregate variables and remember which variables this wereaggregate_and_document_scale
Convert formr run structure to data.frameas.data.frame.formr_api_run_structure
Transform formr_item_list into a data.frame for ease of useas.data.frame.formr_item_list
knit_child as isasis_knit_child
switch choice values with labelschoice_labels_for_values
Gives the last element, doesn't omit missingscurrent
generates valid email cidsemail_image
How many surveys were expired?expired
Text feedback based on groupsfeedback_chunk
How many surveys were finished?finished
Gives the first non-missing elementfirst
Aggregate data based on item tableformr_aggregate
Aggregate Scalesformr_api_aggregate
Authenticate with formrformr_api_authenticate
Backup a studyformr_api_backup_run
Create a new runformr_api_create_run
Create Session(s)formr_api_create_session
Delete ALL files attached to a runformr_api_delete_all_files
Delete file(s) from a runformr_api_delete_file
Delete a Runformr_api_delete_run
Delete a Surveyformr_api_delete_survey
Lower-level API Result Fetcherformr_api_fetch_results
List files attached to a runformr_api_files
Check if currently authenticatedformr_api_is_authenticated
Revoke Access Token (Logout)formr_api_logout
Pull Project from Server Scaffolds folder structure if missing, then overwrites local files with Server state.formr_api_pull_project
Push Project to Serverformr_api_push_project
Apply Type Definitions and Labelsformr_api_recognise
Get and Process Run Resultsformr_api_results
Reverse Items and Update Labelsformr_api_reverse
Get or Update Run Settingsformr_api_run_settings
Get or Update Run Structure (Run Units)formr_api_run_structure
List all runsformr_api_runs
Get Current API sessionformr_api_session
Perform Action on Session(s)formr_api_session_action
List Sessions in a Runformr_api_sessions
Get Survey Structure (Items)formr_api_survey_structure
List Surveysformr_api_surveys
Get token expiry informationformr_api_token_expiry
List Per-Unit Sessions in a Runformr_api_unit_sessions
Upload File(s) to Runformr_api_upload_file
Upload/Update Surveyformr_api_upload_survey
Backup uploaded files from formrformr_backup_files
Backup a studyformr_backup_study
Backup surveysformr_backup_surveys
Connect to formrformr_connect
Get or set the default directory for downloads and backupsformr_default_dir
Disconnect from formrformr_disconnect
render inline text for formrformr_inline_render
Download detailed result timings and display counts from formrformr_item_displays
Download items from formrformr_items
knit rmarkdown to markdown for formrformr_knit
Get the last specified hostformr_last_host
Render a participant-flow Sankey for an overview scriptformr_overview_sankey
Processed, aggregated resultsformr_post_process_results
Download data from formrformr_raw_results
Recognise data types based on item tableformr_recognise
render text for formrformr_render
render inline text for formrformr_render_commonmark
Download processed, aggregated results from formrformr_results
Reverse items based on item table or a fallback_maxformr_reverse
Download run structure from formrformr_run_structure
Download random groupsformr_shuffled
Simulate data based on item tableformr_simulate_from_items
Store Credentials in Keyringformr_store_keys
Upload new item tableformr_upload_items
Download uploaded files from formrformr_uploaded_files
Download random groupsformr_user_detail
Download random groupsformr_user_overview
pass in the url to the RDS representation of a openCPU session object, get the objectget_opencpu_rds
Replace NA values with something elseif_na
This function makes sure you know what to expect when evaluating uncertain results in an if-clause. In most cases, you should not use this function, because it can lump a lot of very different cases together, but it may have some use for fool-proofing certain if-clauses on rforms.org, where a field in a survey may either not exist, be missing or have a value to check.if_na_null
Like 'ifelse()', but allows you to assign a third value to missings.ifelsena
checks whether the current time is in a certain time windowin_time_window
get item from survey attributeitem
get item list from survey attributesitems
knit prefixedknit_prefixed
Gives the last non-missing elementlast
custom markdown options for rmarkdown's pandocmarkdown_custom_options
github_markdown for rmarkdownmarkdown_github
hard line breaksmarkdown_hard_line_breaks
checks whether a new day has broken (date has increased by at least one day)next_day
paste.knit_asispaste.knit_asis
Print method for formr run structureprint.formr_api_run_structure
Print new lines in knit_asis outputsprint.knit_asis
Plot normed values as a barchartqplot_on_bar
Plot a normed value on the standard normalqplot_on_normal
Time-polar plotqplot_on_polar
Random date in rangerandom_date_in_range
render textrender_text
Rescue lost attributesrescue_attributes
Reverse labelled valuesreverse_labelled_values
Summarize Processing Historysummary.formr_results
Send text message via Clickatelltext_message_clickatell
Send text message via Massenversand.detext_message_massenversand
Send text message via Twiliotext_message_twilio
checks how much time has passed relative to the user's last actiontime_passed
word_document from rmarkdown, but has an added option not to break on errorword_document