[Qgis-user] RE: manageR doesn't work well

Carson Farmer carson.farmer at gmail.com
Mon May 23 09:22:31 PDT 2011


> I added R folder in the PATH environment variable but its not helping me
> with my problem. Actually, manageR can be loader correctly in QGIS but when
> I try to import a shapefile with the tool Import Layer from Canvas, I cannot
> perform analysis on this data. It seems manageR cannot load the data which
> is a simple polygon shapefile with an attribute table of strings and
> numbers. When I type ls() or objects() in manageR I got the awnser
> character(0) which means there is no variable loaded.
>
> Im on Windows 7 32bit, QGIS 1.7.0 R 2.11.0 and Rpy2 2.0.3-1
>
> Anybody have successfuly performed an analysis on a shapefile with manageR ?
Lots of people have, so it is possible ;-) Did you check that both the
sp and rgdal packages were installed as I mentioned before?
What happens if you type something like the following into the manageR console:

> library(rgdal)
> layer <- readOGR("C:\path\to\your\layer.shp", layer="shape")

also, see ?readOGR to make sure your arguments are correct.

Alternatively, you can use the "Analysis > Spatial operations > Load
OGR data" menu if you like.

Carson

> ________________________________
> Date: Mon, 23 May 2011 02:42:11 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: RE: manageR doesn't work well
>
> Hi,
>
> a very common source of problems with R and QGIS is not having the
> "bin" folder of C:\Program Files\R-x.y in your PATH environment
> variable. It is necessary and not created by R installation
> automatically.
>
> Vaclav
>
> 2011/5/22 Carson Farmer <[hidden email]>:
>> hmm, Ok, well the only other thing I can think of is that you might
>> need to install the following packages:
>>
>> install.packages(c("sp", "rgdal"))
>>
>> Carson
>>
>> On Sun, May 22, 2011 at 3:22 PM, burton449 <[hidden email]> wrote:
>>> Hi Carson,
>>>
>>> Sorry, my mistake, I use R 2.11.0 because in this version the executable
>>> are
>>> stored in a subdirectory that rpy2 can read. Newer version of R its not
>>> working with rpy2. I will try your trick to change the code in the
>>> __init__.py but I dont think it would solve my problem. Actually manageR
>>> is
>>> loading in QGIS but its not working properly.
>>>
>>> Thank you
>>> Maxime
>>>
>>> ________________________________
>>> Date: Sun, 22 May 2011 06:11:10 -0700
>>> From: [hidden email]
>>> To: [hidden email]
>>> Subject: Re: manageR doesn't work well
>>>
>>> Hi Maxime,
>>>
>>>> Im using manageR 1.0, QGIS 1.7 and 1.6 and R 1.11.0 on Windows 7
>>> Are you sure you're using R 1.11.0? That's a pretty old version! Also,
>>> which version of rpy2 are you using? Furthermore, I attach an email
>>> from another manageR using with a possible solution for Windows 7
>>> issues:
>>>
>>> I had a problem getting ManageR to run on QGIS 1.60 (OSGeoW4 install)
>>> with R-2.12.1 (32 bit) on Windows 7 64 bit systems. Rpy2 complained
>>> about not finding R.dll.
>>> Newer versions of R place the executable files in a new subdirectory,
>>> i386, below the bin directory on Windows 7 systems.
>>>
>>> After searching the net for a while, I finally found the following
>>> post, which seems to fix the problem:
>>> http://www.mail-archive.com/rpy-list@.../msg02779.html
>>>  Try adding these two lines to rinterface/__init__.py
>>>     # Load the R dll using the explicit path
>>>     # First try the bin dir:
>>>     Rlib = os.path.join(R_HOME, 'bin', 'R.dll')
>>>     # Try bin/i386 subdirectory seen in R 2.12.0  ## ADDED ##
>>>     if not os.path.exists(Rlib):                ## ADDED ##
>>>       Rlib = os.path.join(R_HOME, 'bin', 'i386', 'R.dll')  ## ADDED ##
>>>     # Then the lib dir:
>>>     if not os.path.exists(Rlib):
>>>       Rlib = os.path.join(R_HOME, 'lib', 'R.dll')
>>>     # Otherwise fail out!
>>>     if not os.path.exists(Rlib):
>>>       raise RuntimeError("Unable to locate R.dll within %s" % R_HOME)
>>>
>>> Hope that helps a bit,
>>>
>>> Carson
>>>
>>> --
>>> Carson J. Q. Farmer
>>> ISSP Doctoral Fellow
>>> National Centre for Geocomputation
>>> National University of Ireland, Maynooth,
>>> http://www.carsonfarmer.com/
>>> _______________________________________________
>>> Qgis-user mailing list
>>> [hidden email]
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>>
>>> ________________________________
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://osgeo-org.1803224.n2.nabble.com/manageR-doesn-t-work-well-tp5543144p6391395.html
>>> To unsubscribe from manageR doesn't work well, click here.
>>> ________________________________
>>> View this message in context: RE: manageR doesn't work well
>>> Sent from the qgis-user mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> [hidden email]
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>>
>>
>>
>>
>> --
>> Carson J. Q. Farmer
>> ISSP Doctoral Fellow
>> National Centre for Geocomputation
>> National University of Ireland, Maynooth,
>> http://www.carsonfarmer.com/
>> _______________________________________________
>> Qgis-user mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://osgeo-org.1803224.n2.nabble.com/manageR-doesn-t-work-well-tp5543144p6393737.html
> To unsubscribe from manageR doesn't work well, click here.
> ________________________________
> View this message in context: RE: manageR doesn't work well
> Sent from the qgis-user mailing list archive at Nabble.com.
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>



-- 
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation
National University of Ireland, Maynooth,
http://www.carsonfarmer.com/



More information about the Qgis-user mailing list