View source: R/swift-function.R
| swift_function | R Documentation |
Dynamically define an R function with Swift source code. Compiles and links
a shard library with bindings to the Swift function then defines an R function
that uses .Call to invoke the library.
swift_function(
code,
env = globalenv(),
imports = c("Foundation"),
cache_dir = tempdir()
)
code |
Source code for the Swift function definition. |
env |
Environment where the R functions and modules should be made available. |
imports |
Character vector of Swift frameworks to import. |
cache_dir |
Directory to use for caching shared libraries. The default
value of |
Remember that the function need to be public and that you need to put
the required @_cdecl ("…") decorator before the function definition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.