Skip to content

Commit

Permalink
import R's ahead Pt.30
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrymoudiki committed Jan 9, 2024
1 parent 56b0c27 commit c6364f5
Show file tree
Hide file tree
Showing 2 changed files with 6 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 = "46f05200cddf872b921f5a689ba5e9fc31a70e39"
git-tree-sha1 = "0a3b3d26d65a7d442d2d28e778cd888ea7249898"
repo-rev = "main"
repo-url = "https://github.com/Techtonique/Ahead.jl"
uuid = "e561dd4c-0aa7-4ba4-aacb-df50ed0db7d4"
Expand Down
8 changes: 5 additions & 3 deletions src/Ahead.jl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit c6364f5

Please sign in to comment.