[R-sig-Geo] knearneigh: data non-numeric

Frede Aakmann Tøgersen frtog at vestas.com
Fri Sep 12 10:01:14 CEST 2014


Hi

You are showing metadata for gadmsimpl3_poly

But the error you see is for object gadmsimpl4_poly.

Does that have something to do with your problem?

Yours sincerely / Med venlig hilsen


Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender. 

> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-
> project.org] On Behalf Of Andreas Forø Tollefsen
> Sent: 12. september 2014 09:35
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] knearneigh: data non-numeric
> 
> Hi all,
> 
> I have never experienced this issue before, but I assume there is something
> in my spatialpolygondataframe causing this.
> Whenever I try to create a knn object using these data, I get the error
> "knearneigh: data non-numeric".
> 
> The code used:
> knearneigh(gadmsimpl4_poly,k = 4,longlat = FALSE)
> Error in knearneigh(gadmsimpl4_poly, k = 4, longlat = FALSE) :
> knearneigh: data non-numeric
> 
> Any ideas what might be causing this error? I cannot remember seeing this
> before.
> 
> Andreas
> 
> Metadata:
> > class(gadmsimpl3_poly)
> [1] "SpatialPolygonsDataFrame"
> attr(,"package")
> [1] "sp"
> > length(colnames(gadmsimpl3_poly at data))
> [1] 84
> > length(gadmsimpl3_poly)
> [1] 1095
> > gadmsimpl3_poly at bbox
>         min      max
> x -25.36181 50.48654
> y -34.63487 25.00001
> > gadmsimpl3_poly at proj4string
> CRS arguments:
>  +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
> 
> 	[[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



More information about the R-sig-Geo mailing list