Rj Editor (Error using System R)

Everything related to the development of modules in jamovi
Vit
Posts: 65
Joined: Fri Apr 19, 2019 11:51 am

Re: Rj Editor (Error using System R)

Post by Vit »

jmvcore is 0.9.6.4 installed via RStudio. Even after a fresh install no change.
User avatar
SvenHeimbuch
Posts: 8
Joined: Fri Dec 14, 2018 12:37 pm

Re: Rj Editor (Error using System R)

Post by SvenHeimbuch »

I'm also having issues in using System R with Rj Editor. I'm have jamovi 1.0.4 flatpak (Arch Linux) and R 3.6.1 running on my machine.

When I try to switch from jamovi R to System R, I'm getting this:

Code: Select all

R

To use the system R from jamovi, jmvconnect must be installed

Debug

Error: To use the system R from jamovi, jmvconnect must be installed

private$.run()
stop(message, call. = FALSE)
jmvconnect 1.0.8 is installed (and reinstalled multiple times...) and this is what I get when I try to access spreadsheet data from RStudio when I have a running jamovi instance open:

Code: Select all

library(jmvconnect)
> read()
Error in if (is_http) { : argument is of length zero
> what()
Error in if (is_http) { : argument is of length zero
Any ideas? Any more input required to debug?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Rj Editor (Error using System R)

Post by jonathon »

hi sven,

hmm, looks like an error in the httr package ... but no idea why. however, there are complications with using the system R with Rj under linux, due to the sandboxing. but you should still be able to achieve what you want. take a look here:

viewtopic.php?f=6&t=698&p=2466#p2466

come back to us if you get stuck

cheers

jonathon
shabde
Posts: 16
Joined: Thu Aug 29, 2019 7:53 pm

Re: Rj Editor (Error using System R)

Post by shabde »

Hi Jonathon,

first congrats for a great development as JAMOVI!

I am writing because I have an issue running the RJeditor / jmvconnect under R 3.6.0 in Windows 10. I am using Jamovi 1.1.2.0, but the error is also present with earlier versions. When I try to use the system R in RJ Editor, I get the following error:
Error in readRDS(file = outputPath): cannot read workspace version 3 written by R 3.6.0; need R 3.5.0 or newer
private$.run()
readRDS(file = outputPath)
In RStudio, I can successfully do library (jmvconnect), but when I type what(), I get:
Error in if (is_http) { : argument is of length zero
I still have R 3.5.2 on my system, and have tried to force Jamovi to use it by changing the registry key, but then jmvconnect was not found (albeit installed).

Can you help me out?

Cheers,
Steffen
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Rj Editor (Error using System R)

Post by jonathon »

hi,

so between major versions of R, the libraries are kept separate, so if you've installed `jmvconnect` for 3.6, you'll need to reinstall it for 3.5.

what version of `httr` are you using?

if you've got some time to try some things for me, i'd like to try and get to the bottom of the is_http issue, which seems httr related.

with thanks

jonathon
shabde
Posts: 16
Joined: Thu Aug 29, 2019 7:53 pm

Re: Rj Editor (Error using System R)

Post by shabde »

Thanks Jonathon!

Your hint was right. I had a win environmental variable still pointing to the 3.6 user library, that seemed to be the problem. When only the 3.5 installation of jmvconnect was accessible, Rj editor worked again.

Coming to the other topic:
I am using httr 1.4.1 in R 3.5 and R 3.6. I am getting the is_http error in both environments when I type what().
Sure I can try something, that's the least for such a great development!

Cheers,
Steffen
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Rj Editor (Error using System R)

Post by jonathon »

OK, it looks like there's been a regression in the httr package. i've pushed a new version of jmvconnect to CRAN (1.0.9) which works around the issue, and should show up in the next little while.

thanks for alerting us to this

with thanks

jonathon
shabde
Posts: 16
Joined: Thu Aug 29, 2019 7:53 pm

Re: Rj Editor (Error using System R)

Post by shabde »

works perfect now! Thanks a lot for the update!
anaco
Posts: 2
Joined: Wed Oct 02, 2019 3:55 am

Re: Rj Editor (Error using System R)

Post by anaco »

Hello Jonathon,
I am also struggling to connect jamovi 1.0.7.0 with the System R on a Windows 10 machine with R 3.4.3 (downloaded from CRAN). I chose R 3.4. because in the jamovi library you state that "when using the 'System R', Rj is currently not compatible with R 3.5 or newer."
When installing the jmvconnect package directly from R, the default package version is 1.0.8.
The default latest pushed version 1.0.9 from the CRAN repository ("r-release" in https://cran.r-project.org/web/packages/jmvconnect/) is nevertheless for the R 3.6 version.
Also the package for the R 3.5. version (r-oldrel) gives following error
InternetOpenUrl failed: 'A connection with the server could not be established' for:

How is the Rj Editor supposed to work with jmvconnect?

Thank you,
Constantin
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Rj Editor (Error using System R)

Post by jonathon »

hi,

we kinda got sandwhiched here with a bunch of breakage from different directions.

this is what happened:

1. R broke .rds backward compatiblity between 3.4 and 3.5

this wasn't the end of the world, because it still worked with R 3.4

2. the httr package developers introduced a bug which broke things, and aren't responding to bug reports, or offers to fix the issue

3. i push out 1.0.9 of jmvconnect which works around the bug in httr

4. CRAN doesn't build R packages for old R versions

5. fml

so there's a couple of things you could try:

1. rolling back to an earlier version of httr, from before they introduced the bug.
2. building 1.0.9 from source (unfortunately this is made complicated by the package relying on native code, so you have to install all the Rtools malarky).

i'm planning on upgrading the version of R we ship, which will fix these issues, but it's a largish task and i haven't got to it yet.

i appreciate this sucks, but i kinda got shafted here.

jonathon
Post Reply