Skip to content

Commit cc0fb5e

Browse files
author
Frankie Robertson
committed
Add RCall.debuginfo() helper to clarify RCall environment
1 parent 997d330 commit cc0fb5e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/RCall.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ if Rhome == ""
5656
__precompile__(false)
5757
end
5858

59+
include("versioninfo.jl")
5960
include("types.jl")
6061
include("Const.jl")
6162
include("methods.jl")

src/versioninfo.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Print some useful information about the current RCall.jl setup.
3+
If `all` is false, only RCall.jl information is printed, otherwise
4+
information about your Julia and R setup is printed as well.
5+
"""
6+
function versioninfo(; all=true)
7+
if all
8+
println("RCall.jl information:")
9+
end
10+
version = pkgversion(RCall)
11+
prefix = all ? "\t" : ""
12+
println("$(prefix)RCall.jl version $version")
13+
println("$(prefix)R location configured with Preferences.jl: $Rhome_set_as_preference")
14+
println("$(prefix)RCall.jl managed R using Conda.jl: $conda_provided_r")
15+
println("$(prefix)Rhome: $Rhome")
16+
println("$(prefix)libR: $libR")
17+
if all
18+
println()
19+
println("Julia information:")
20+
buffer = IOBuffer()
21+
Main.versioninfo(buffer)
22+
seek(buffer, 0)
23+
for line in eachline(buffer)
24+
println("\t" * line)
25+
end
26+
println()
27+
println("R information:")
28+
lines = reval("capture.output(sessionInfo())")
29+
for line in lines
30+
println("\t" * rcopy(line))
31+
end
32+
end
33+
end

0 commit comments

Comments
 (0)