Skip to content
Prev 19106 / 29559 Next

Using the ENFA from adehabitatHS in R with sp classes

Dear Alannie,

Obviously all these "data"s are confusing :)
The 'enfa' example uses a dataset call 'lynxjura' (not 'data'), which is a 
list with several elements. One of these elements is the maps, with the 
name 'map' (singular!). This is what you want to achieve. This is simply a 
SpatialPixelsDataFrame, but as far as I can tell, a SpatialGridDataFrame 
will do too (if you want to know more about the differences between these 
two, check the sp vignette).

So, following your example, just replace "map" by "join", and it should 
work. The 'slot(map, "data")' line extracts the data frame storing the data 
of the map, since the dudi.pca and enfa functions do not directly need the 
spatial attributes.

Hope this helps,
Mathieu.


Le 08/14/2013 02:23 PM, alannie a ?crit :