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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user