[Qgis-user] QGIS-R

Matteo Ghetta matteo.ghetta at gmail.com
Thu Jun 11 02:27:58 PDT 2015


HI Daniel,
you can also find a small small tutorial here:

https://github.com/qgis/QGIS-Documentation/blob/master/source/docs/training_manual/processing/r_intro.rst

You are more then welcome if you want to add some of your scripts or if you
want to write some tutorial/exercise.

Cheers

Matteo



2015-06-11 6:12 GMT+02:00 Daniel Torres <nobeeakon at gmail.com>:

> Hi every one, I'm having a hard time with Sextante and R. I'm trying to
> make a little script to calculate the sum of a variable per cathegory, the
> script runs in R, but I can't understand how to make it work in QGIS...
>
> I haven't found many examples on QGIS-R, and the few ones use only one
> variable...
>
> Any help is welcome (any documentation or examples are very welcome),
> Thanks,
> Daniel
>
>
>
>
> ##Basic statistics=group
> ##Layer=vector
> ##valores=Field Layer
> ##categorias=Field Layer
> valores<-Layer[[valores]]
> categorias<-Layer[[categorias]]
> catego<-as.factor(categorias)
> catego_unicos<-unique(catego)
> suma<-NA;suma<-data.frame(suma)
> for(i in 1:length(catego_unicos)){
> suma[i,1]<-sum(valores[catego==catego_unicos[i]])
> }
> colnames(suma)<-"suma"
> rownames(suma)<-catego_unicos
> >suma
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150611/81770510/attachment.html>


More information about the Qgis-user mailing list