juliaPut: Create a Julia proxy object from an R object

View source: R/main.R

juliaPutR Documentation

Create a Julia proxy object from an R object

Description

This function can be used to copy R vectors and matrices to Julia and keep them there. The returned proxy object can be used in place of the original vector or matrix. This is useful to prevent that large R vectors / matrices are repeatedly translated when using an object in multiple calls to Julia.

Usage

juliaPut(x)

Arguments

x

an R object (can also be a translated Julia object)

Examples

if (juliaSetupOk()) {

   # Transfer a large vector to Julia and use it in multiple calls
   x <- juliaPut(rnorm(100))
   # x is just a reference to a Julia vector now
   juliaEval("using Statistics")
   juliaCall("mean", x)
   juliaCall("var", x)

}



JuliaConnectoR documentation built on Oct. 9, 2024, 1:08 a.m.