Skip to contents

An environment that the rforms.org server fills with per-request state when R code runs inside an OpenCPU session on a formr study (for example, on a CalculateUnit page or an OverviewScriptPage). Useful fields the server may set:

Usage

.formr

Format

An environment.

Value

An environment holding per-request state in its bindings (the run_name, host, access_token, last_action_time and last_action_date fields listed above). .formr is a data object, not a function, so it does not itself return a value; the rforms.org server populates these bindings before user code runs and the environment is empty outside a formr/OpenCPU session.

Details

  • .formr$run_name – the name of the current run.

  • .formr$host – the API host (e.g. https://api.rforms.org).

  • .formr$access_token – a short-lived OAuth token for the request.

  • .formr$last_action_time / .formr$last_action_date – timestamps used by time_passed() and the other shorthands.

Several user-facing functions (e.g. formr_api_authenticate(), formr_api_results(), formr_overview_sankey()) default their host / run_name / access_token arguments to these fields, so the same code runs unchanged locally and on a formr study. Outside a formr session the environment is empty.