<div dir="ltr"><div>Hi Victor,</div>Having a separated libloc causes also a maintenance problem, as the libs in there can only be updated (with ease) by SEXTANTE, that does not (?) update them. I also think that it is better to have everything on system level but there are also environments where a user has no writing privileges outside its user space and a user libloc is required (this does R by default in such a case, but it asks the user to create that dir if it doesn't already exits, and R re-connects to that user libloc every time it starts with the same user). <div>
<br></div><div>So except for the problem (esily to solve) of permissions and user libloc I would stay within R defaults.</div><div><br></div><div>I think that SEXTANTE offers a good place to share scripts, _especially_ for non R experts (like the example scripts). I.e. I create an R-script that my colleagues can use without knowing R. I think this is one of the great things of SEXTANTE!</div>
<div><br></div><div>I think it is (quite) easily possible to remove the need of R knowledge for a lot of situations, one of these it the installation and update of packages. It is much easier to share a Rscript (rsx) to another system if not installed packages are added automatically.</div>
<div><br></div><div>It could be interesting to have also a online repository of RSX scripts, isn't every R-script is a bit like a plugin!? </div><div><br></div><div>Cheers, Matteo</div><div><br></div><div><br></div><div>
  </div><div><br></div><div> </div><div><br></div><div>    <br><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/12 Victor Olaya <span dir="ltr"><<a href="mailto:volayaf@gmail.com" target="_blank">volayaf@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matteo<br>
<br>
Thanks for your help<br>
<br>
After some thinking and discussion, I think that the best and easiest<br>
solutions is just to have a separate SEXTANTE environment, with its<br>
own libPath. This is the current configuration, but it was not<br>
correctly set, so libs were installed tere, but not used from there<br>
later. With Donovan's solution, this wil be easy to fix.<br>
<br>
The R connector in SXTANTE is supposed to be used by people that can<br>
use R and write R scripts, so I guess we can let them add the<br>
necessary install commands for their scripts. SEXTANTE will just take<br>
care of rgdal, since that is used very often.<br>
<br>
What I will try to do is:<br>
- document this in detail in the manual<br>
- improve the error handling, so if the R script cannot be run due to<br>
a missing dependency, SEXTANTE will inform the user. For this, your<br>
scripts might be useful.<br>
<br>
I want to treat the R scripts much in the same way as the Python<br>
scripts. If you need a lib (other that the ones installed with QGIS),<br>
you have to install it yourself, modify the PYTHONPATH add the import<br>
sentences, etc...and I assume that you know Python well enough to take<br>
care of that. The same goes with R scripts. By having a separate R<br>
environment, I guess this is easier and also it will not interfere in<br>
the "normal" usage of R outside SEXTANTE. And we also get rid of the<br>
problem of not having priviledges to install new packages, since all<br>
goes to the home folder.<br>
<br>
What do you think of this?<br>
<br>
Thanks again!<br>
Victor<br>
<br>
<br>
<br>
2013/7/12 Matteo Mattiuzzi <<a href="mailto:matteo@mattiuzzi.com">matteo@mattiuzzi.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Hi guys I hope I'm not to late for the lunch,<br>
><br>
> I have attached a (mature draft) Rscript that check if all needed packages<br>
> are installed (needed because in the given rscript.rsx there are some<br>
> "require(..." or "library(...")<br>
> One my Linux it works fine.<br>
> Note that it currently doesn't check for SEXTANTE R default packages as<br>
> raster/rgdal... but it would be no problem to add them by default.<br>
> Currently it installs to the default lib location (so you need to have write<br>
> access (in the R promt if the folder does not exist R asks you if you want<br>
> to create a libloc where you have write access, this could be problematic<br>
> and this is probably the reason for the sextante /R lib loc?, if this is a<br>
> problem, I can use the sextante R lib loc).<br>
><br>
> Depending on where you save these files the command is:<br>
> R CMD BATCH "--args ~/exampleScriptNotOk.rsx" ~/checkPac.R<br>
> R CMD BATCH "--args ~/exampleScriptOk.rsx" ~/checkPac.R<br>
><br>
> This command should be started on every Rscripr.rsx execution before the<br>
> real execution as it tries to make sure thet the packages requirement are<br>
> all ok. If no installation is required it is very fast, here 1/3 of a sec.<br>
> see ceckPac.Rout for the full execution log<br>
><br>
> If this method is an option some testing from your side would be great! This<br>
> is only a suggestion, ant it can be easily addapted/changed/enhanced.<br>
><br>
> Matteo<br>
><br>
><br>
> 2013/7/12 Alister Hood <<a href="mailto:Alister.Hood@synergine.com">Alister.Hood@synergine.com</a>><br>
>><br>
>> Hi guys,<br>
>> Speaking of R, would it be worth adding some maintenance scripts? e.g.<br>
>><br>
>> update.packages(checkBuilt=TRUE)<br>
>><br>
>> and even:<br>
>><br>
>> if(!require(installr)) {<br>
>> install.packages("installr"); require(installr)} #load / install+load<br>
>> installr<br>
>> updateR()<br>
>><br>
>> I'm not much of an R guy - maybe there are other things too.<br>
>><br>
>> Regards,<br>
>> Alister<br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
</div></div></blockquote></div><br></div>