generic
Generic R function caller.
Use call() to invoke R functions by name (including brms functions) when there
is no dedicated wrapper in brmspy.brms.
Notes
Executed inside the worker process that hosts the embedded R session.
Functions¶
sanitised_name(function)
¶
Sanitize a function name for safe R execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
str
|
Function name (optionally namespaced, e.g. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A sanitized name where invalid characters are replaced with underscores, and where leading digits are avoided (except after a namespace). |
Examples:
call(function, *args, **kwargs)
¶
Call an R function by name with brmspy type conversion.
This is intended as an escape hatch for R/brms functionality that does not yet have a dedicated wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
str
|
Function name. If not namespaced, brmspy tries |
required |
*args
|
Positional arguments. |
()
|
|
**kwargs
|
Keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Converted return value. |
Examples: