Skip to Content.

mget-help - RE: [mget-help] Error in calculating Diversity Index

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] Error in calculating Diversity Index


Chronological Thread 
  • From: Jason Roberts <>
  • To: Ana Mafalda Tomás Correia <>
  • Cc: "" <>
  • Subject: RE: [mget-help] Error in calculating Diversity Index
  • Date: Thu, 7 Feb 2019 18:46:56 +0000
  • Accept-language: en-US

Hi Mafalda,

 

Thanks for bringing this to our attention and for posting your workaround. I’m not sure what was happening with 3.4.3. When the error occurred, MGET was asking R to calculate the diversity index. Part of that involved calling the R xtabs function; the failure was that R could not find that function. This is very unusual because xtabs is part of the R “stats” package, which is part of the base R installation. Thus it should always be available.

 

It is quite possible there is something deeper at play here, but if not, then the problem was likely that there was something broken in the R 3.4.3 installation, and installing R again—either an older or newer version, or even 3.4.3 again—should fix the problem. But it is possible I have misdiagnosed the issue. I will look into this further...

 

Finally, I should mention that because MGET runs only in the 32-bit version of Python (necessitated by the historical limitation of ArcMap and ArcCatalog being 32-bit only), MGET will only use the 32-bit version of R. So when you do install R, if you would like MGET to be able to use it, be sure you allow the R installer to install the 32-bit version of R as well as the 64-bit version. (It installs both by default, but it is possible to disable one or the other in the installation program.)

 

All the best,

 

Jason

 

From: <> On Behalf Of Ana Mafalda Tomás Correia
Sent: Thursday, February 7, 2019 12:43 PM
To:
Subject: Re: [mget-help] Error in calculating Diversity Index

 

Dear Nicholas,

 

I just solved the problem by installing an older version of R (3.3.1).

 

Thank you.

 

Sincerely,

Mafalda

 

Ana Mafalda Tomás Correia <> escreveu no dia quinta, 7/02/2019 à(s) 17:11:

Dear Nicholas,

 

I just installed the latest version of MGET (0.8a71) and I am trying to run the diversity tool. I tried all indexes but I am getting the same error every time:

 

"Executing: SpeciesDiversityCalculateDiversityIndexForArcGISPolygons grid_100km_tot_ef_er_sp "Simpson's index of diversity" simpsons sightings_db species group_size # #

Start Time: Thu Feb  7 17:09:55 2019

Running script SpeciesDiversityCalculateDiversityIndexForArcGISPolygons...

Intersecting the points with the polygons.

Summing species counts per polygon.

Reading species counts into memory.

Query complete: 0:00:01 elapsed, 990 rows retrieved, 0:00:00.001972 per row.

RPy_RException: Error in xtabs(Count ~ PolygonFID + SpeciesID, tmp1141112723) : 

  could not find function "xtabs"

Obtaining additional debugging information. This may cause this tool to hang. If you do not see any additional messages after one minute, halt its execution.

Failed script SpeciesDiversityCalculateDiversityIndexForArcGISPolygons...

 

Traceback (most recent call last):

  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\SpeciesDiversityCalculateDiversityIndexForArcGISPolygons.py", line 5, in <module>

    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.SpatialAnalysis.Diversity', 'SpeciesDiversity', 'CalculateDiversityIndexForArcGISPolygons')

  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\ArcGISScripts.py", line 210, in ExecuteMethodFromCommandLineAsArcGISTool

    exec sourceCode in globals(), locals()

  File "<string>", line 1, in <module>

  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\SpatialAnalysis\Diversity.py", line 145, in CalculateDiversityIndexForArcGISPolygons

    result = r('diversity(xtabs(Count ~ PolygonFID + SpeciesID, %s), "%s")' % (dataFrameName, veganIndexName))

  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\R.py", line 1094, in __call__

    value = self._Object(str(statements))

  File "C:\Python27\ArcGIS10.6\lib\site-packages\GeoEco\AssimilatedModules\rpy\rpy.py", line 339, in __call__

    return self.eval(self.parse(text=s))

RPy_RException: Error in xtabs(Count ~ PolygonFID + SpeciesID, tmp1141112723) : 

  could not find function "xtabs"

 

 

Failed to execute (SpeciesDiversityCalculateDiversityIndexForArcGISPolygons).

Failed at Thu Feb  7 17:10:13 2019 (Elapsed Time: 17,67 seconds)"

 

Is it something to do with my version of R (at the moment, x64 3.4.3)?

 

Thank you in advance.

 

Sincerely,

Mafalda

 

--

Ana Mafalda Correia

Bolseira Doutoramento / PhD Student

 

 

 

CIIMAR | Interdisciplinary Centre of Marine and Environmental Research of the University of Porto

Terminal de Cruzeiros do Porto de Leixões

Avenida General Norton de Matos, S/N

4450-208 Matosinhos | Portugal | Tel. (+351) 223 401 805

E-mail:  | www.ciimar.up.pt | www.facebook.com/ciimar.up.pt

 

 

Knowledge of the Ocean as a basis for the sustainable management and exploitation of resources


 

--

Ana Mafalda Correia

Bolseira Doutoramento / PhD Student

 

 

http://www.ciimar.up.pt/informatica/signature/signature1.png

 

CIIMAR | Interdisciplinary Centre of Marine and Environmental Research of the University of Porto

Terminal de Cruzeiros do Porto de Leixões

Avenida General Norton de Matos, S/N

4450-208 Matosinhos | Portugal | Tel. (+351) 223 401 805

E-mail:  | www.ciimar.up.pt | www.facebook.com/ciimar.up.pt

 

http://www.ciimar.up.pt/informatica/signature/signature2.jpg

 

Knowledge of the Ocean as a basis for the sustainable management and exploitation of resources




Archive powered by MHonArc 2.6.19.

Top of Page