Skip to contents

Load and attach patter, connect to Julia via julia_connect() and then run julia_validate() to validate the RJulia interface works.

Usage

julia_validate()

Value

The function returns invisible(NULL), unless an error is experienced.

Details

This function validates the RJulia interface with an example terra::SpatRaster that is exported to Julia and then modified in R. If the function returns nothing, you should be good to go. On some systems, we have observed segmentation faults that crash R when the map is exported to Julia and/or modified in R. Please report issues.

See also

See julia_connect() to connect R to Julia.

Author

Edward Lavender

Examples

if (patter_run(.geospatial = FALSE)) {

  library(testthat)

  # Connect `R` to `Julia`
  julia_connect()

  # Validate the connection
  # * If the function returns NULL, we are good to go.
  # * Otherwise, an error will be raised (or `R` will crash).
  expect_null(julia_validate())

}
#> `patter::julia_connect()` called @ 2025-04-22 09:30:55... 
#> ... Running `Julia` setup via `JuliaCall::julia_setup()`... 
#> ... Validating Julia installation... 
#> ... Setting up Julia project... 
#> ... Handling dependencies... 
#> ... `Julia` set up with 11 thread(s). 
#> `patter::julia_connect()` call ended @ 2025-04-22 09:30:55 (duration: ~0 sec(s)).