Hello every body, I am using rpy2_2.0.8 with postgres and Qgis. The code that I wrote is the following:
def on_calcola_pressed (self): # bottone per calcoli statistici import rpy2 import rpy2.robjects as robjects import rpy2.robjects as ro r = robjects.r robjects.r r.library("RPostgreSQL") r.library("gstat") r.library("zoo") rcmd_drv = r["dbDriver"] rcmd_con = r["dbConnect"] rcmd = r["dbListTables"] rcmd_archezoology_table = r["dbReadTable"] png = r.png drv = rcmd_drv("PostgreSQL") con = rcmd_con(drv, host="127.0.0.1", dbname="pyarchinit", port="5432", password="enzo", user="postgres") archezoology_table = rcmd_archezoology_table(con,"archeozoology_table") r.png(file="/home/enzo/Scrivania/prova.png",width=512,height=512) plot = r.plot zoo = r.zoo ('VGM_PARAM_A3 <- gstat(id="bos_bison", formula=combusto~1,locations=~coord_x+coord_y, data=archezoology_table, nmax = 10) VGM_PARAM_A3 <- gstat(VGM_PARAM_A3, "calcinati", strie~1, locations=~coord_x+coord_y, archezoology_table, nmax = 10)VGM_PARAM_A3 <- gstat(VGM_PARAM_A3, "camoscio", cervo~1, locations=~coord_x+coord_y,archezoology_table, nmax = 10) VGM_PARAM_A3 <- gstat(VGM_PARAM_A3, model=vgm(1, "Sph", 5, 0), fill.all=TRUE ESV_A3 <- variogram(VGM_PARAM_A3, cutoff=9) VARMODEL_A3 = fit.lmc(ESV_A3, VGM_PARAM_A3)') plot(zoo('ESV_A3, model = VARMODEL_A3,xlab=,ylab=,pch=20, cex=0.7, col="red",main="Linear Model of Coregionalization for A3 variables"')) The error is the following: res = super(RFunction, self).__call__(*new_args, **new_kwargs) RRuntimeError: Error in plot.window(...) : invalid 'ylim' value Do you have a suggestion or examples about how to call a function with the gistat module on a postgress tab using rpy2? Thank you, Enzo -- Enzo Cocca (PhD Candidate) Research Fellow Università di Napoli "L'Orientale" mail: enzo....@gmail.com cell: +393495087014 [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.