XRJulia and findJulia - r

I am trying to get XRJulia to run, and the first task is to get R to recognise Julia. I followed the answer on this question, which did not solve my problem.
This what I did: After installing Julia I went to the systems variable menu and I added the the bin location of the installation directory, something like “D:\ProgramFiles\Julia-0.6.1\bin” to the path system variable. Note that I am able to start Julia from the command prompt after doing that.
And this is the result:
library(XRJulia)
findJulia(test = TRUE)
[1] FALSE
So, the question is, what am I missing?
I am using R 3.4.2, Julia 0.6.1, and windows 10.

I had similar issue and this is how I found out the issue and fixed it.
First:
library(JuliaCall)
julia_setup()
and no surprise it failed.
Added key Julia_HOME and correct Julia bin path in windows environment setting. Tried again.
Loading setup script for JuliaCall...
However, after a several minutes:
ERROR: LoadError: RCall not properly installed. Please run Pkg.build("RCall")
So opened Julia and rebuilt RCall.
Tried again and it worked fine.
Tried:
library(XRJulia) findJulia(test = T)
and it all worked out.

Related

Julia fails to precompile packages ExcelFiles, Plots and JuMP

I am a beginner with using Julia and I am trying to use the packages. However, when I try to use the packagegs Excelfiles, plots and JuMP. I use this code for the packages:
Pkg.add("JuMP")
using JuMP
I get the error: ERROR: Failed to precompile JuMP [4076af6c-e467-56ae-b986-b466b2749572] to C:\Users\yobbi.julia\compiled\v1.7\JuMP\jl_39BC.tmp. I already updated the packages, restarted my laptop, and downloaded Julia again but I keep getting this error. Can someone help me out? Thanks!
Try:
using Pkg
pkg"build JuMP"
This will either resolve your problem or show you errors in the package build process.
Please also note that "reinstalling" Julia usually not helps as Julia is keeping its files in the .julia folder.
Finally, your folder C:\Users\yobbi.julia looks fishy to me. Maybe it is a typo and it should be C:\Users\yobbi\.julia or you managed to misconfigure something with the JULIA_DEPOT_PATH variable.

Cannot configure rgee R package properly with ee_install()

I've searched for tutorials to help configure the package in my PC, and I've found this one: https://www.youtube.com/watch?v=_fDhRL_LBdQ
I executed every part of the code interactively with the tutorial, but when I run ee_install() (after installing miniconda with py_discover_config() and other packages previously, such as reticulate), but it keeps me returning an error saying that anaconda is mandatory for the package since I'm a windows user.
Here is the error I get:
Error in ee_install_set_pyenv_env(py_env = py_env, py_path = python_path, : Windows users must install miniconda/anaconda to use rgee. The use of a Python environment is mandatory.
I've just installed Anaconda (full version with navigator) and I set a new python environment called "py2r" and tried to use the function ee_install_set_pyenv(), passing the path to the environment created through Anaconda Navigator (which has a python.exe) as paremeter to py_path and the name "py2r" as paremeter for py_env arg. And yet, it didn't work.
What am I missing?
In case you want to take a look at the code, I can provide it, but I don't think it's necessary because is a simple test script that follows as I described.
Thanks for your attention and congratulations for the library, it will be very usefull for me at work!
I fixed the ee_install() problems bypassing them and doing every passage manually. It will require no more then 10 mins and you will probably fix the installation problems. You can find and follow the manual installation with this tutorial:
https://www.youtube.com/watch?v=1-k6wNL2hlo

R plot doesn't work on my Windows, but plot.default does

I'm taking a course in R and I've hit a road block on day one.
Typing:
demo(graphics)
...should start a series of graphs being displayed on screen. On my Windows 10 (64 bit) new Dell laptop, I get a persistent error:
The execution is stopped after the red lines, seemingly because the demo(graphics) call is being made with incompatible parameters. In blue I make the same call but use the default function and an empty plot is displayed.
I have tried uninstalling and reinstalling everything, installing through Anaconda and from the CRAN website. The same error persists. I've even tried with mro instead of basic R.
I don't see any similar error messages in my class or on Google. My guess is that I need to install a particular version of R and RStudio make it work but I'm guessing.
Can anybody offer some expertise?
I'm running R version 3.6.1 (2019-07-05) (which is executing code correct, just not the demo call) and RStudio Version
Running the basic Rgui software from the command line with the --vanilla parameter like so:
Rgui --vanilla
Opened Rgui and the
demo(graphics)
...call worked.
This meant that the issue was in the .Rprofile file. This is found in the etc folder of the basic R installation and when I checked, it looked absolutely fine (entirely commented out actually).
I wanted to use RStudio though, so I investigated the RStudio docs and saw that each project is given its own .Rprofile style initialization file when a new project is created.
So I created a new project with RStudio and by creating a new project whatever configuration issue was causing the error was completely fixed.
Credits to G. Grothendieck for the answer in the comments.

Installing Julia on Atom

I am trying to install Julia on Atom. What I made already is that I installed Julia in this folder :
E:\Program files\Users\Zeedo\AppData\Local\Julia-0.6.3
and I installed Atom. Then, I also installed language-Julia package.
Now, when I want to run a code, I get this error:
Julia could not be started.
We tried to launch Julia from:
julia
This path can be changed in the settings.
Details:
'"julia"' is not recognized as an internal or external command,
operable program or batch file.
So, I don't know where should I give the Julia address to the Atom.Or, if you know something that I am doing wrong, please let me know.
Thanks :)
Atom cannot run code by default, so that error message must be being thrown by a community package you've installed. Searching shows me the package is most likely atom-julia-client. And the error seems to be because it can't find the Julia binary it needs to run the program.
First, you should make sure you can run the julia command from the command line directly, which you can check by running julia --version. If this doesn't work, then you need to add the Julia binary to your path.
If the above didn't work, try go to Settings -> Packages -> julia-client. In here, the first setting is Julia Path, which is defaulted to julia (like in the error). Change this to an absolute path, directly to the binary (or to the folder containing the binary; try both if the first doesn't work).
FYI, the language-julia package just gives you syntax highlighting and snippets, and doesn't actually need any Julia stuff to work.

R: kable_as_image cannot find Ghostscript

I'm re-running some R Markdown scripts that worked fine a month ago, but now kable_as_image is unable to find Ghostscript (yes, I'm on Windows 8). I get the following error message:
Error in kable_as_image(criteria.table,"Criteria",file_format="jpeg"):
Ghostscript is required to read PDF on windows. Please download it here: https://ghostscript.com/
My computer still has Ghostscript, which runs fine when I open it up independently (I tried reinstalling Ghostscript; it didn't help). My guess is that the problem has something to do with R, RStudio, or a package being unable to find the Ghostscript.
I'm pretty sure I've upgraded R in the interim, and I'm currently on 3.4.3 with the latest versions of kableExtra and magick. I've also tried
Sys.setenv(R_GSCMD="C:/Program Files/gs/gs9.22/bin/gswin64.exe")
(and also for gswin64c.exe) but that didn't help, either. Any advice would be appreciated.
Despite what the error message says, R needs the path to MikTeX (or your TeX program of choice), not to Ghostscript itself. The best solution is to add it to PATH in your operating system directly so it's always there, but it also works to add it within R. This is helpful to test it out before digging into your OS (make sure you have the right path), or if you don't have administrator privileges to your work machine.
Sys.setenv("PATH"=sprintf("%s;C:\\Users\\me\\AppData\\Local\\Programs\\MiKTeX 2.9\\miktex\\bin\\x64\\",Sys.getenv("PATH")))
Your path to MikTeX will likely be different than mine. Note that you need sprintf() or something similar to add the directory to the end of the PATH instead of overwriting the existing path.

Resources