scicloj / clojisr

Clojure speaks statistics - a bridge between Clojure to R
https://scicloj.github.io/clojisr/
Eclipse Public License 2.0
150 stars 10 forks source link

Fix #62 by preventing the loading of previous R environment. #63

Closed tuh8888 closed 4 years ago

tuh8888 commented 4 years ago

I found that I continued to have trouble establishing a connection (see #62 ) when starting from within a directory containing an existing R project. I found that after deleting the .RData file, I was able to connect successfully. So I went and reupgraded to R4. And the connection worked. So I don't think it was a problem with R4 but something in my environment (saved in the .RData file).

So I restored the .RData file and modified start-rserve in clojisr/v1/impl/rserve/proc.clj by adding the "--no-restore-data" parameter to the spawn call.

And the connection worked! Removing the "--no-restore-data" parameter caused it to fail again.

I'm not sure what was in my environment that caused the issue, but it may be nice to add in the "--no-restore-data" to the call to spawn rserve. Of course, maybe some people will want access to things in their previous environment, so some kind of option could be available.

genmeblog commented 4 years ago

Great! Thanks for finding it.