Skip to content

Commit

Permalink
import R's ahead Pt.31
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrymoudiki committed Jan 9, 2024
1 parent c6364f5 commit fc01b5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Ahead/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project_hash = "7a2d2dd43dcf5281bf3e0bad350fc711c20e25cf"

[[deps.Ahead]]
deps = ["Pkg", "RCall"]
git-tree-sha1 = "0a3b3d26d65a7d442d2d28e778cd888ea7249898"
git-tree-sha1 = "5cebb59c31c9497274c24726660ca155f091a502"
repo-rev = "main"
repo-url = "https://github.com/Techtonique/Ahead.jl"
uuid = "e561dd4c-0aa7-4ba4-aacb-df50ed0db7d4"
Expand Down
10 changes: 7 additions & 3 deletions src/Ahead.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ 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"if(inherits(install_ahead, 'try-error'))"
R"if(inherits(install_ahead, 'try-error')) {}"

function foo(x)
# https://juliainterop.github.io/RCall.jl/stable/custom/#Nested-conversion
print("in function 'foo'")
R"library(ahead)"
return rcopy(R"ahead::dynrmf(c(1, 2, 3, 4, 5))")
R"try(library(ahead), silent = TRUE)"
try
res = rcopy(R"ahead::dynrmf(c(1, 2, 3, 4, 5))")
catch
res = 0
return res
end

# exports
Expand Down

0 comments on commit fc01b5b

Please sign in to comment.