Skip to content

Commit 748aa66

Browse files
author
Frankie Robertson
committed
Update fix_r_preferences to current preferred version
1 parent 44add3d commit 748aa66

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

docs/fix_r_preferences.jl

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1+
using Libdl
12
using CondaPkg
23
using Preferences
3-
using Libdl
4-
using PreferenceTools
4+
using UUIDs
55

6-
function locate_libR(Rhome)
7-
@static if Sys.iswindows()
8-
libR = joinpath(Rhome, "bin", Sys.WORD_SIZE == 64 ? "x64" : "i386", "R.dll")
9-
else
10-
libR = joinpath(Rhome, "lib", "libR.$(Libdl.dlext)")
11-
end
12-
return libR
13-
end
6+
const RCALL_UUID = UUID("6f49c342-dc21-5d91-9882-a32aef131414")
147

15-
CondaPkg.resolve()
16-
target_rhome = "$(CondaPkg.envdir())/lib/R"
17-
PreferenceTools.add("RCall",
18-
"Rhome" => target_rhome,
19-
"libR" => locate_libR(target_rhome))
8+
CondaPkg.add("r")
9+
target_rhome = joinpath(CondaPkg.envdir(), "lib", "R")
10+
if Sys.iswindows()
11+
target_libr = joinpath(target_rhome, "bin", Sys.WORD_SIZE==64 ? "x64" : "i386", "R.dll")
12+
else
13+
target_libr = joinpath(target_rhome, "lib", "libR.$(Libdl.dlext)")
14+
end
15+
set_preferences!(RCALL_UUID, "Rhome" => target_rhome, "libR" => target_libr)

0 commit comments

Comments
 (0)