Open s3alfisc opened 2 years ago
Hi Alex,
thanks, good to know that you found the package useful!
Sure, you could start writing a package JuliaConnectoR.utils
. Let me know about your progress and we can decide whether some of the functionality could also be integrated directly in the package. I am a bit hesitant to create too many functions inside the JuliaConnectoR
package that do not provide really substantial things because I want to keep the interface manageable.
But I could imagine that a function like setupJulia(version, installDir, manifest)
, which makes sure that the given Julia version and packages are installed (and if not, install them) could be a nice addition to the package.
For the use by developers of packages, I would recommend to specify the dependencies via a Manifest.toml file instead of simple version numbers. Looking forward to see your suggestions.
Best wishes,
Stefan
Hi Stefan!
Thanks for your reply - I completely understand that you'd like to keep the package as lean as possible. I will try to set up a JuliaConnectoR.utils
package and will let you know once I have something to show!
Best, Alex
Hi Stefan, I have now hacked together a super simple JuliaConnectoR.utils package. It currently consists of five functions:
install_julia()
is a wrapper around JuliaCall::install_julia()
and installs Julia from within Rconnect_julia_r()
opens the .renviron
file and gives some instruction on what to do so that the JuliaConnectoR
finds Juliainstall_julia_packages()
is a vectorized function that allows to install Julia packages from within Rcheck_julia_system_requirements()
parses the Description
file and checks if the R sessions' current Julia version and version numbers of required packages match the requirements (this function is super hacky)set_julia_nthreads()
gives some instructions on how to control the number of threads used in Julia from within RHence a workflow utilizing JuliaConnectoR.utils
(for R users who have never before had any contact with Julia) could look like this:
library(JuliaConnectoR.utils)
install_julia()
connect_julia_r()
devtools::install_github("s3alfisc/fwildclusterboot")
install_julia_packages("WildBootTests.jl")
check_julia_system_requirements("fwildclusterboot")
set_julia_nthreads()
Let me know what you think!
Best, Alex
Hi Alex, sorry for the delay but I currently have some other urgent projects going on.
check_julia_system_requirements
: I would advise to use a Julia Manifest file instead of developing an additional syntax of defining Julia packages in the R description file.connect_julia_r
and set_julia_nthreads
: This does not seem to be targeted to package developers but to end users. As an end users, I would rather find it tedious to edit my .renviron file for a package and it is hard to know about that. I rather go for good defaults and documenting possibilities for alternative configurations.That are my thoughts so far, sorry that I am not more constructive at the moment.
Hi Stefan & coauthors,
First of all,
JuliaConnectoR
is a joy to work with - running Julia from R works like a charm!At the moment, I am working on an R wrapper package of @droodman's WildBootTests.jl package. In order for the wrapper package (with its superior implementation of the wild cluster bootstrap) to be wildly used, it is critical that the installation of all Julia components is as easy as possible for Julia-inexperienced R users (but also more experienced R users might struggle a bit with setting environmental variables). I believe that setting up a set of "template" functions that standardizes downloading Julia & connecting Julia and R would greatly facilitate the integration of Julia code into R software.
I have invested a little bit into a smooth installation experience - the utilities for
wildboottestjlr
currently depend on theusethis
andJuliaCall
packages & it would be great to cut down on these dependencies.E.g. in the wildboottestjlr_setup function, I
JuliaCall::install_julia()
renviron
file viausethis::edit_r_environ()
and give an explanation what to paste in there via a messageWildBootTests.jl
by runningI think it would be a great idea to add a set of utility function to
JuliaConnectoR
or to write a custom package, e.g.JuliaConnectoR.utils
that package developers can import as a dependency which makes all these things extremely convenient.Such a package would preferably make it easy to
I would be happy to work on a first draft for some of these utility functions!
Best, Alex