Skip to Content.

mget-help - RE: [mget-help] how to run two versions of R with MGET

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] how to run two versions of R with MGET


Chronological Thread 
  • From: Jason Roberts <>
  • To: "Dilts, Thomas" <>
  • Cc: "" <>
  • Subject: RE: [mget-help] how to run two versions of R with MGET
  • Date: Fri, 21 Oct 2016 19:02:32 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is ) ;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Tom,

MGET's Distance sampling tools are built on top of some of the R packages
maintained by Dave Miller and his colleagues at University of St. Andrews.
They provide a means to fit and predict detection functions from ArcGIS. But
they do not provide all of the capabilities you would obtain by working in R
directly. If you are comfortable working in R, you might prefer to work there
so you have the full power of that environment.

MGET's distance sampling tools are currently in maintenance mode, but if
funding comes through it is likely we'll overhaul and expand them during the
2018-2020 timeframe as part of a joint project with St. Andrews. I know that
timeframe is a ways out. On the plus side, if it is funded it is very likely
to happen. So little of MGET is funded directly that development is
unpredictable; this project would be an pleasant exception...

Best,
Jason

-----Original Message-----
From: Dilts, Thomas []
Sent: Friday, October 21, 2016 2:45 PM
To: Jason Roberts <>
Cc:
Subject: RE: how to run two versions of R with MGET

Thanks Jason. This is great information. Actually it helps me out in some
other instances (I'd like to run stuff in a teaching lab, but don't want to
mess with their version of R). We also realized a little late that MGET also
has a Distance Sampling Toolset so we'll give that a short first. I don't
think that the uninstalling and reinstalling options are too heavy handed. R
installs pretty quickly compared to ArcGIS. The environmental variable trick
should come in handy. I can see where it would be nice to change that
on-the-fly. -Tom
------------------------------------------------------------------
Thomas Dilts, MS
Research Scientist
Great Basin Landscape Ecology Lab
Department of Natural Resources and Environmental Science University of
Nevada Reno
(775) 784-1447
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cabnr.unr.edu_weisberg_&d=CwIFAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=cJfJ4ejc1xbg_qb47Pg1OoRq1GfFGvWbDD2PT7-fBKk&m=x8OwEWXScraQS0P1rChu3uGKsrjLpX2yJOwhpMaG_6E&s=WDJThPde-vOUWdyxh7zQEDKqQ1ELg3ap0sXNi-lbCGY&e=
https://urldefense.proofpoint.com/v2/url?u=http-3A__gislandscapeecology.blogspot.com_&d=CwIFAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=cJfJ4ejc1xbg_qb47Pg1OoRq1GfFGvWbDD2PT7-fBKk&m=x8OwEWXScraQS0P1rChu3uGKsrjLpX2yJOwhpMaG_6E&s=nad7ymLvQxPUdu5gRtf6NBrdqXmN1V_nvaqyQ0gbaTo&e=


________________________________________
From: Jason Roberts []
Sent: Friday, October 21, 2016 11:27 AM
To: Dilts, Thomas
Cc:
Subject: RE: how to run two versions of R with MGET

Hi Tom,

As I believe you know, R supports multiple versions being installed at the
same time. Assuming you haven't done anything to your machine other than
install multiple versions of R, MGET will use the most recent one that was
installed with the option that says to write the R version to the Windows
registry. I forget exactly how that installation option is worded in the R
installer, but it is enabled by default. So one solution is to install the
version you want MGET to use last. If that version is already installed, you
could uninstall it and install it again, as a kind of heavy-handed way of
getting its version number to be the last one written to the registry. (You
could manually tweak the registry as well.)

A second alternative is to set the R_HOME environment variable. To use R
3.2.4, you'd set it to "C:\Program Files\R\R-3.2.4". This can be done
surgically, in a just-in-time manner, e.g. 1) create a CMD shell, 2) set
R_HOME, 3) start ArcGIS from that CMD shell (e.g. by running "C:\Program
Files (x86)\ArcGIS\Desktop10.4\bin\ArcMap.exe" from the command prompt of
that shell). Once you set the variable for the running CMD shell process, any
child processes will inherit the environment variables.

You could also upgrade or downgrade your R from 3.2.4. There was a build
problem in that release of R and I was not able to add support for it. But if
you go to any other older or newer version, MGET will work.

If the problem is getting the Distance package running on a version other
than 3.2.4, you can contact Dave Miller for support with that. I can help you
make that connection, if needed.

Hope this helps,

Jason

-----Original Message-----
From:
[] On Behalf Of Dilts, Thomas
Sent: Friday, October 21, 2016 1:32 PM
To:
Subject: [mget-help] how to run two versions of R with MGET

Hi Jason and listerservers,

My colleague one office down gets the following error when trying to run Fit
GLM. He needs R 3.2.4 for the distance package. How can we programmatically
run two versions of R with MGET? Is there a universal script that can be
altered to point to the earlier version of R or does each tool need to be
modified?

Executing: GLMFitToArcGISTable
F:\Nevada\Fecal_Data\R_poop\Cow_seg_arc.xlsx\cow_trunc1416$
F:\Nevada\Fecal_Data\R_poop\ArcModel.Rdata estpoops quasipoisson "costdist
#;elev #;tpi1000m #;tpi20000m #" year;hma;allot # # # # # # # true true true
3 # true false true true png 1000 3000 3000 10 white Start Time: Fri Oct 21
09:41:31 2016 Running script GLMFitToArcGISTable...
<type 'exceptions.RuntimeError'>: No module named _rpy3024

RPy module can not be imported. Please check if your rpy
installation supports R 3.2.4. If you have multiple R versions
installed, you may need to set RHOME before importing rpy. For
example:

>>> from rpy_options import set_options
>>> set_options(RHOME='c:/progra~1/r/rw2011/')
>>> from rpy import *


Failed to execute (GLMFitToArcGISTable).
Failed at Fri Oct 21 09:41:41 2016 (Elapsed Time: 10.00 seconds)

------------------------------------------------------------------
Thomas Dilts, MS
Research Scientist
Great Basin Landscape Ecology Lab
Department of Natural Resources and Environmental Science University of
Nevada Reno
(775) 784-1447
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cabnr.unr.edu_weisberg_&d=CwIFAw&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=xCrbnFZcjrfVEdKQhMVPxwdYw2imyfElky5AJEHT_VA&m=4PF7YEqUYZEy4MLwdtIILtkUA12Y1AUrorH6OmZVnl0&s=ol3X97uy5IBkWV6OnDvyLWSsksGGv_rp9rQJHB1vm_0&e=
https://urldefense.proofpoint.com/v2/url?u=http-3A__gislandscapeecology.blogspot.com_&d=CwIFAw&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=xCrbnFZcjrfVEdKQhMVPxwdYw2imyfElky5AJEHT_VA&m=4PF7YEqUYZEy4MLwdtIILtkUA12Y1AUrorH6OmZVnl0&s=drc_F-g-TQ9wCozGMBZ6k_zWsUP7UWxCou3zPpoiDHk&e=



Archive powered by MHonArc 2.6.19.

Top of Page