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 <[email protected]>: > 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 > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-user >
_______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
