[SoC] Re: [Qgis-developer] [SoC report] home range analysis in QGIS

Tim Keitt tkeitt at keittlab.org
Sat Aug 9 00:08:12 EDT 2008


On Fri, Aug 8, 2008 at 6:25 PM, Tim Sutton <tim at linfiniti.com> wrote:
> Hi
>
>>
>> This usually happens when the Ubuntu version of R falls behind the
>> R-project version of R. There is no organized effort to back port CRAN
>> packages. Best thing to do is use the CRAN apt repository for R so you
>> keep in sync with CRAN packages.
>>
>> My sources.list includes:
>>
>> deb http://cran.stat.ucla.edu/bin/linux/ubuntu hardy/
>>
>> Substitute a mirror listed at r-project.org. Then apt upgrade or
>> apt-get install r-base.
>>
>> THK
>>
>
>
> Hmm I think this has take things from bad to worse. I setup the third
> party repo as you suggested and installed r-base. Then I installed
> adehabitat and I used a US mirror this time instead of a local South
> African one. After downloading a heap of stuff (ouch!) it gave this:
>
> ** preparing package for lazy loading
> Loading required package: tripack
> Warning in library(pkg, character.only = TRUE, logical.return = TRUE,
> lib.loc = lib.loc) :
>  there is no package called 'tripack'
> Error: package 'tripack' could not be loaded

Generally this only happens when a repository gets out of sync with
the main CRAN repos, and its usually temporary while new versions get
pushed. I have occasionally found flaky CRAN repositories, so hunt
around. Try going directly to CRAN in Austria. Tripack should be there
(its been in R for ages). Also some R packages can be installed via
apt, so be sure to do an apt-get upgrade to sync with the R
repository.

Actually, the other reason this could occur is if the package author
forget to include tripack in the dependencies. See if you can install
it manually ie install.packages('tripack', dep = T).

As a last resort, packages can be downloaded from CRAN (tar.gz format)
and installed with sudo R CMD INSTALL <pkg> or R CMD INSTALL -l
<r-lib-dir> <pkg> if you have a different site-lib dir.

> Execution halted
> ERROR: lazy loading failed for package 'spdep'
> ** Removing '/home/timlinux/R/i486-pc-linux-gnu-library/2.7/spdep'
>
> The downloaded packages are in
>        /tmp/RtmptmjHUE/downloaded_packages
> There were 17 warnings (use warnings() to see them)
>
>
> Also, now when I start QGIS I get a long warning for the home range plugin:
>
> Couldn't load plugin "pluginProva" from
> ['/home/timlinux/apps/share/qgis/python',
> '/home/timlinux/.qgis//python/plugins',
> '/home/timlinux/apps/share/qgis/python/plugins', '/home/timlinux',
> '/home/timlinux/dev/python/lib', '/usr/lib/python25.zip',
> '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
> '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
> '/usr/local/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages/Numeric',
> '/usr/lib/python2.5/site-packages/PIL',
> '/usr/lib/python2.5/site-packages/gst-0.10',
> '/var/lib/python-support/python2.5',
> '/usr/lib/python2.5/site-packages/gtk-2.0',
> '/var/lib/python-support/python2.5/gtk-2.0']
>
> Traceback (most recent call last):
>  File "", line 2, in
>  File "/home/timlinux/.qgis//python/plugins/pluginProva/__init__.py",
> line 32, in
>    from plugin import HRPlugin
>  File "/home/timlinux/.qgis//python/plugins/pluginProva/plugin.py",
> line 84, in
>    from rpy import *
>  File "/usr/lib/python2.5/site-packages/rpy.py", line 134, in
>    """ % RVERSION)
> RuntimeError: No module named _rpy2071
>
>      RPy module can not be imported. Please check if your rpy
>      installation supports R 2.7.1. 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 *
>
>
>
> Python version:
> 2.5.2 (r252:60911, Jul 31 2008, 17:44:49)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
>
> Python path:['/home/timlinux/apps/share/qgis/python',
> '/home/timlinux/.qgis//python/plugins',
> '/home/timlinux/apps/share/qgis/python/plugins', '/home/timlinux',
> '/home/timlinux/dev/python/lib', '/usr/lib/python25.zip',
> '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
> '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
> '/usr/local/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages',
> '/usr/lib/python2.5/site-packages/Numeric',
> '/usr/lib/python2.5/site-packages/PIL',
> '/usr/lib/python2.5/site-packages/gst-0.10',
> '/var/lib/python-support/python2.5',
> '/usr/lib/python2.5/site-packages/gtk-2.0',
> '/var/lib/python-support/python2.5/gtk-2.0']
>

I used this version of rpy:

ii  python-rpy                                 1.0.3-2hardy0
                                   Python interface to the GNU R
language and e

and it appears to work fine.

THK

-- 
Timothy H. Keitt, Assistant Professor
University of Texas at Austin http://www.keittlab.org/
Contact info and schedule at http://www.keittlab.org/~tkeitt/
Publications http://www.keittlab.org/biblio


More information about the Soc mailing list