[R-sig-Geo] Errror in 3D s-t variogram {variogramST} gstat

Edzer Pebesma edzer.pebesma at uni-muenster.de
Fri Feb 22 16:37:03 CET 2013


I believe we caught this bug; it should be resolved in 1.0-17, the 
development version of which can be downloaded from r-forge:

https://r-forge.r-project.org/R/?group_id=378

On 02/22/2013 03:55 PM, GEMA FERNANDEZ-AVILES CALDERON wrote:
> Dear list:
>
> I'm trying to fit a spatio-temporal variogram model in gstat.
>
> I'm reading: http://cran.r-project.org/web/packages/gstat/vignettes/st.pdf
>
> My dataset is: CO, 23 Monitoring stations (irregular), 24 hours.
> I create a STFDF object and it looks fine, but when I try to create
> a variogramST, I found an error. (I'm attaching the code)
>
> I have read a previous discussion about it but I cann't solve my error.
>
> Please, could you help me?
>
> Thanks in advance,
> Gema
>
>
>
> ##--------------------------------------------------------------------------------------##
>
>> sp = cbind(coords[,1], coords[,2])
>> row.names(sp) = paste("point", 1:nrow(sp), sep="")
>> sp = SpatialPoints(sp)
>
>> time = as.POSIXct("2008-01-01")+3600*(00:23)
>> #select 24 hours
>> dia.co=co_stl_23[1:24,]
>>
>> mydata = (length(sp)*length(time),dia.co)
>> mydata = data.frame(values = signif(mydata,3), ID=IDs)
>> stfdf.co = STFDF(sp, time, mydata)
>>
>> summary(stfdf.co)
>
> Object of class STFDF
>   with Dimensions (s, t, attr): (23, 24, 2)
> [[Spatial:]]
> Object of class SpatialPoints
> Coordinates:
>                  min     max
> coords.x1  436436.6  448850
> coords.x2 4470109.5 4481161
> Is projected: NA
> proj4string : [NA]
> Number of points: 23
> [[Temporal:]]
>       Index                       timeIndex
>   Min.   :2008-01-01 00:00:00   Min.   : 1.00
>   1st Qu.:2008-01-01 05:45:00   1st Qu.: 6.75
>   Median :2008-01-01 11:30:00   Median :12.50
>   Mean   :2008-01-01 11:30:00   Mean   :12.50
>   3rd Qu.:2008-01-01 17:15:00   3rd Qu.:18.25
>   Max.   :2008-01-01 23:00:00   Max.   :24.00
> [[Data attributes:]]
>       values               ID
>   Min.   :-3.12000   ID 1   : 46
>   1st Qu.:-0.75150   ID 10  : 46
>   Median :-0.01895   ID 11  : 46
>   Mean   : 0.03365   ID 12  : 46
>   3rd Qu.: 0.75600   ID 2   : 46
>   Max.   : 2.94000   ID 3   : 46
>                      (Other):276
>> #plot
>> stplot(stfdf.co)
>
>> st.var<- variogramST(values ~ 1, data=stfdf.co, tlags=0:5)
>
> Error en if (nrow(x) < nrow(y)) matrix(t(apply(x, 1, spDiN1, y = y, ll = longlat)),  :
>    argumento tiene longitud cero
>
>
> ##--------------------------------------------------------------------------------------##
>
>
>
>
> Gema Fernández-Avilés
>
> Department of Statistics
> Faculty of Law and Social Sciences
> University of Castilla-La Mancha at Toledo
>
> http://www.uclm.es/profesorado/gemafaviles/
> New book: http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118413180.html
>
> 	[[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list