Opened 9 years ago

Closed 9 years ago

#20 closed defect (fixed)

Home Range QGIS plugin works only with R 2.9.2

Reported by: gmanghi Owned by: Anne Ghisla
Priority: major Milestone:
Component: HomeRange_plugin Version:
Keywords: windows Cc:

Description

A month ago I conducted a few tests with both windows Seven and Ubuntu Linux and seems that actually the HR plugin works just if is installed R 2.9.2

http://lists.faunalia.it/pipermail/animov/2010-September/000673.html

Under Linux rgdal cannot be installed because it needs R >= 2.10. Using R 2.11 just a two of the available methods work.

http://lists.faunalia.it/pipermail/animov/2010-September/000679.html

Change History (10)

comment:1 Changed 9 years ago by a.ghisla@…

Works now on my Fedora 14 box, see

svn diff -r 354:355

This solves GDAL Error 1 - Invalid index -1.

Please test!

comment:2 Changed 9 years ago by giovanni.manghi@…

Hi Anne.

I took a fresh XP installation, installed qgis/osgeo4w, rpy2, R 2.12, placed the R path in the "path" windows environment variable, installed the necessary R packages and when installing the plugin I get (a python error and)

"Unable to locate R.dll"

It seems (not sure) that in this R version a few files have been moved to \bin\i386 (where I see R.dll now). R.exe still inside \bin

Under Ubuntu (10.04, R 2.10 from repository) I keep getting

Traceback (most recent call last):
  File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 75, in 
    QObject.connect(self.buttonBox, SIGNAL("accepted()"), lambda mth=mth: self.run(mth))
  File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 182, in run
    if not robjects.r.require(i)[0]:
  File "/usr/lib/python2.6/dist-packages/rpy2/robjects/__init__.py", line 423, in __call__
    res = super(RFunction, self).__call__(*new_args, **new_kwargs)
RRuntimeError: Error: package 'sp' could not be loaded

when trying to run the plugin.

comment:3 Changed 9 years ago by giovanni.manghi@…

PS

after installation the plugin manager keep saying that the plugin is upgradeable to 2.1.7

comment:4 in reply to:  2 ; Changed 9 years ago by a.ghisla@…

Replying to giovanni.manghi@…:

Hi Anne.

I took a fresh XP installation, installed qgis/osgeo4w, rpy2, R 2.12, placed the R path in the "path" windows environment variable, installed the necessary R packages and when installing the plugin I get (a python error and)

"Unable to locate R.dll"

It seems (not sure) that in this R version a few files have been moved to \bin\i386 (where I see R.dll now). R.exe still inside \bin

This error is better to be reported to rpy2 bug tracker, as there is no code of HR plugin that takes care of this problem.

Under Ubuntu (10.04, R 2.10 from repository) I keep getting

Traceback (most recent call last):
  File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 75, in 
    QObject.connect(self.buttonBox, SIGNAL("accepted()"), lambda mth=mth: self.run(mth))
  File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 182, in run
    if not robjects.r.require(i)[0]:
  File "/usr/lib/python2.6/dist-packages/rpy2/robjects/__init__.py", line 423, in __call__
    res = super(RFunction, self).__call__(*new_args, **new_kwargs)
RRuntimeError: Error: package 'sp' could not be loaded

In a R terminal, is the sp package loaded correctly?

Snippet:

require(sp)

in a Python terminal:

import rpy2
import rpy2.robjects as robjects
robjects.r.require("sp")[0]

again, it is a dependency problem. I'd like to discuss on how to handle tickets about dependencies on the mailing list.

Replying to giovanni.manghi@…:

after installation the plugin manager keep saying that the plugin is upgradeable to 2.1.7

Sorry I can't see what's wrong in metadata.. On pyqgis.org it shows 2.1.7, in init.py too. Where else do I have to check?

Thanks for reports!

comment:5 in reply to:  4 Changed 9 years ago by giovanni.manghi@…

This error is better to be reported to rpy2 bug tracker, as there is no code of HR plugin that takes care of this problem.

I installed R 2.11 and I confirm that there is no i386 folder. R.exe and R.dll are in the same folder \bin

This way the plugin installs under windows, but it keep popping

R error (please consult its documentation) is:
Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") : 
	GDAL Error 1: Invalid index : -1

but I'm not sure I'm using 2.1.7, because it keep saying it is upgradeable to 2.1.7...

In a R terminal, is the sp package loaded correctly?

Snippet:

require(sp)

in a Python terminal:

import rpy2
import rpy2.robjects as robjects
robjects.r.require("sp")[0]

again, it is a dependency problem. I'd like to discuss on how to handle tickets about dependencies on the mailing list.

I'll test again in a fresh ubuntu box, I may have problems with my R packages. I'll let you know.

comment:6 Changed 9 years ago by giovanni.manghi@…

Hi Anne,

I made a fresh installation of all the stack in a Ubuntu 10.10 machine and it works fine.

The issues I still see:

*) check if the error under Windows depends of a missed update or if is something platform related

*) report to rpy2 devs that in R 2.12 R.dll (and others files) now resides in a subfolder in \bin (speaking about windows)

*) the plugin really need a progress bar and it need to be modeless (like the gdal tools) because otherwise the calculations can leave stuck the user for many minutes wondering if it freezed or not. For example with the sample dataset, the NNCH kernel takes a lot of minutes to run (on a not very powerful machine. And to tell the truth I don't even know if it ended correctly... I get bored to wait and I shut down the pc... but I believe that it was still running, even if the QGIS windows became irresponsive).

comment:7 Changed 9 years ago by giovanni.manghi@…

PS

when more than one available point layers is in the TOC the plugin shows the entries repeated in the dropdown.

comment:8 in reply to:  6 Changed 9 years ago by giovanni.manghi@…

And to tell the truth I don't even know if it ended correctly... I get bored to wait and I shut down the pc... but I believe that it was still running, even if the QGIS windows became irresponsive).

I gave it a try again... NNCH, with the sample dataset returned a (R) error... (copy/paste didn't worked between the virtual machine and the host machine, sorry).

comment:9 in reply to:  7 Changed 9 years ago by a.ghisla@…

Keywords: windows added

Replying to giovanni.manghi@…:

PS

when more than one available point layers is in the TOC the plugin shows the entries repeated in the dropdown.

Please refer to ticket #22, otherwise we won't close this ticket until all problems signaled will be solved :)

Replying to giovanni.manghi@…:

after installation the plugin manager keep saying that the plugin is upgradeable to 2.1.7

My bad, fixed some time ago.

I confirm the plugin v 2.1.7 works fully under Fedora 14 - see wiki page for the working configuration - and see that it works in Ubuntu too.

For Windows, most probably rpy2 needs a patch to work with the new R 2.10 paths, but no support is provided by rpy2 team - see rpy2 2.1 documentation - so a Windows Pythonista able to provide a patch will be most welcome.

Stay tuned!

comment:10 Changed 9 years ago by giovanni.manghi@…

Resolution: fixed
Status: newclosed

I tested the latest plugin version with R 2.11.1 on both linux and windows and the sample dataset. The plugin works fine under both platforms.

So... until rpy2 for windows will be updated we just need to specify clearly to the users that is needed to use R 2.11.x. Anne what is the right place where to write this note?

I don't believe that R 2.12 under linux will bring problems, but I haven't tested yet.

Note: See TracTickets for help on using tickets.