[R-sig-Geo] Help with ENFA in R

JonathanAronson jagaronson at gmail.com
Mon Apr 15 13:16:01 CEST 2013

Hi Alexandre

I have looked at the examples already and those in SP package too before I
posted my question.
When I run this line of code from the example: pr <- slot(count.points(locs,
join), "data")[,1], I get the following error:

Error in count.points(locs, join) : 
  w should inherit the class SpatialPixels

So I am trying to coerce my object "join" from a spatialgriddataframe to a
spatialpixeldataframe. However, I have used this code to do that which I
found in help examples: test <- as(join, "SpatialPixels")

I get this error:

Error in as(join, "SpatialPixels") : 
  no method or default for coercing “data.frame” to “SpatialPixels”

So I cant convert my "join" data frame in the spatial pixels I  need to get
the pr object. Ive tried updating my SP package but it still didnt work
after that. In the SP package vignette it says that, with reference to
SpatialPixels and SpatialGrids: "Objects can be coerced from one
representation to the other" but I get the above mentioned error when I try
do this.


View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Help-with-ENFA-in-R-tp7583243p7583322.html
Sent from the R-sig-geo mailing list archive at Nabble.com.

More information about the R-sig-Geo mailing list