From c6364f55e1956f9bb399fd0c8327c490123764b1 Mon Sep 17 00:00:00 2001 From: thierrymoudiki Date: Tue, 9 Jan 2024 16:46:38 +0100 Subject: [PATCH] import R's ahead Pt.30 --- Ahead/Manifest.toml | 2 +- src/Ahead.jl | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Ahead/Manifest.toml b/Ahead/Manifest.toml index 199ec31..90db2b6 100644 --- a/Ahead/Manifest.toml +++ b/Ahead/Manifest.toml @@ -6,7 +6,7 @@ project_hash = "7a2d2dd43dcf5281bf3e0bad350fc711c20e25cf" [[deps.Ahead]] deps = ["Pkg", "RCall"] -git-tree-sha1 = "46f05200cddf872b921f5a689ba5e9fc31a70e39" +git-tree-sha1 = "0a3b3d26d65a7d442d2d28e778cd888ea7249898" repo-rev = "main" repo-url = "https://github.com/Techtonique/Ahead.jl" uuid = "e561dd4c-0aa7-4ba4-aacb-df50ed0db7d4" diff --git a/src/Ahead.jl b/src/Ahead.jl index 8b87805..573cfc0 100644 --- a/src/Ahead.jl +++ b/src/Ahead.jl @@ -1,6 +1,7 @@ module Ahead if Sys.islinux() + run(`ls -la`) run(`sudo apt update`) run(`sudo apt install r-base r-base-dev -y`) end @@ -27,12 +28,13 @@ module Ahead R"options(repos = c(techtonique = 'https://techtonique.r-universe.dev', CRAN = 'https://cloud.r-project.org'))" R"install_ahead <- try(utils::install.packages('ahead', dependencies=TRUE), silent = TRUE)" - R"stopifnot(!inherits(install_ahead, 'try-error'))" - R"library(ahead)" + R"if(inherits(install_ahead, 'try-error'))" function foo(x) # https://juliainterop.github.io/RCall.jl/stable/custom/#Nested-conversion - return rcopy(R"ahead::dynrmf(c(1, 2 ,3 ,4, 5))") + print("in function 'foo'") + R"library(ahead)" + return rcopy(R"ahead::dynrmf(c(1, 2, 3, 4, 5))") end # exports