Skip to content

R code

R runs through WebR, R compiled to WebAssembly. It is the language to use when the check you care about is statistical rather than structural: response-time distribution, error rate, rolling averages.

SymbolRole
inputThe value received on the input port
varsThe run variables
cat(...), print(...)Write to the execution log
The last expressionIts value leaves on the result port

Scalars are unwrapped; a named list comes back out as a JSON object.

temps <- unlist(input$temps_ms)
moyenne <- mean(temps)
p95 <- quantile(temps, 0.95)
cat(sprintf("moyenne %.1f ms, p95 %.1f ms\n", moyenne, p95))
list(moyenne = moyenne, p95 = unname(p95), n = length(temps))

Wire the output onto an lt Assert to fail the run if the p95 exceeds your budget.

The packages field accepts CRAN packages, served from WebR’s WebAssembly repository.

The R engine is a shared singleton, whose runs are queued. A long R script therefore delays the others in the same run — keep them short, or raise the timeout accordingly.