[R-sig-Geo] Error with gwr.mixed in GWmodel package
binbinlu at whu.edu.cn
binbinlu at whu.edu.cn
Thu Sep 3 13:27:46 CEST 2015
Hi Metastate,
Yes, I found there is a problem in the function gwr.mixed, as the Line 119 code should be :
SpatialPolygonsDataFrame(Sr=polygons, data=mgwr.df, match.ID=F)
but the parameter "match.ID=F" is missed.
I've revised it in the attached code. Currently you can re-source this function after loading the package. It will be fine to run you command. I will update the code in the next submission of package. Cheers.
Best regards,
Binbin
From: Metastate Metastate
Date: 2015-09-03 06:11
To: r-sig-geo
Subject: [R-sig-Geo] Error with gwr.mixed in GWmodel package
Hi,
I applied the gwr.basic and gwr.mixed on the same SPDF file using the codes
below. I got an error message on gwr.mixed:
Error in SpatialPolygonsDataFrame(Sr = polygons, data = mgwr.df) :
row.names of data and Polygons IDs do not match
I had no problem with gwr.basic.
The code I used was:
gwr.res2 <- gwr.basic(Yield_Detrend~Tsfc_4_10+PCP_IN_7_8+PCP_IN_4_6,
data = Yield.spdf.sub,kernel = "bisquare", adaptive = TRUE, bw=50,
F123.test = TRUE)
mgwr.res2 <-gwr.mixed(Yield_Detrend~Tsfc_4_10+Pcp_30D_LT_2IN_4+PCP_IN_7_8
+Elevation, fixed.vars=c("Pcp_30D_LT_2IN_4",
"Elevation"),data = Yield.spdf.sub,kernel = "bisquare", adaptive =
TRUE, bw=50, diagnostic=T)
Also, Is it any easy way I can provide the spdf file if you need it to
check?
Thank you very much for your help.
Meta
[[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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150903/74e8ef7f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gwr.mixed.R
Type: application/octet-stream
Size: 5825 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150903/74e8ef7f/attachment.obj>
More information about the R-sig-Geo
mailing list