[Qgis-developer] SEXTANTE: R output?
Victor Olaya
volayaf at gmail.com
Fri Jul 12 03:56:38 PDT 2013
Matteo
Thanks for your help
After some thinking and discussion, I think that the best and easiest
solutions is just to have a separate SEXTANTE environment, with its
own libPath. This is the current configuration, but it was not
correctly set, so libs were installed tere, but not used from there
later. With Donovan's solution, this wil be easy to fix.
The R connector in SXTANTE is supposed to be used by people that can
use R and write R scripts, so I guess we can let them add the
necessary install commands for their scripts. SEXTANTE will just take
care of rgdal, since that is used very often.
What I will try to do is:
- document this in detail in the manual
- improve the error handling, so if the R script cannot be run due to
a missing dependency, SEXTANTE will inform the user. For this, your
scripts might be useful.
I want to treat the R scripts much in the same way as the Python
scripts. If you need a lib (other that the ones installed with QGIS),
you have to install it yourself, modify the PYTHONPATH add the import
sentences, etc...and I assume that you know Python well enough to take
care of that. The same goes with R scripts. By having a separate R
environment, I guess this is easier and also it will not interfere in
the "normal" usage of R outside SEXTANTE. And we also get rid of the
problem of not having priviledges to install new packages, since all
goes to the home folder.
What do you think of this?
Thanks again!
Victor
2013/7/12 Matteo Mattiuzzi <matteo at mattiuzzi.com>:
> Hi guys I hope I'm not to late for the lunch,
>
> I have attached a (mature draft) Rscript that check if all needed packages
> are installed (needed because in the given rscript.rsx there are some
> "require(..." or "library(...")
> One my Linux it works fine.
> Note that it currently doesn't check for SEXTANTE R default packages as
> raster/rgdal... but it would be no problem to add them by default.
> Currently it installs to the default lib location (so you need to have write
> access (in the R promt if the folder does not exist R asks you if you want
> to create a libloc where you have write access, this could be problematic
> and this is probably the reason for the sextante /R lib loc?, if this is a
> problem, I can use the sextante R lib loc).
>
> Depending on where you save these files the command is:
> R CMD BATCH "--args ~/exampleScriptNotOk.rsx" ~/checkPac.R
> R CMD BATCH "--args ~/exampleScriptOk.rsx" ~/checkPac.R
>
> This command should be started on every Rscripr.rsx execution before the
> real execution as it tries to make sure thet the packages requirement are
> all ok. If no installation is required it is very fast, here 1/3 of a sec.
> see ceckPac.Rout for the full execution log
>
> If this method is an option some testing from your side would be great! This
> is only a suggestion, ant it can be easily addapted/changed/enhanced.
>
> Matteo
>
>
> 2013/7/12 Alister Hood <Alister.Hood at synergine.com>
>>
>> Hi guys,
>> Speaking of R, would it be worth adding some maintenance scripts? e.g.
>>
>> update.packages(checkBuilt=TRUE)
>>
>> and even:
>>
>> if(!require(installr)) {
>> install.packages("installr"); require(installr)} #load / install+load
>> installr
>> updateR()
>>
>> I'm not much of an R guy - maybe there are other things too.
>>
>> Regards,
>> Alister
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
More information about the Qgis-developer
mailing list