[R] Problem with "different" proj4string that are actually identical
Hemery, Lenaig
Lenaig.Hemery at oregonstate.edu
Fri Mar 20 01:29:52 CET 2015
Dear everybody
I am trying to run an Ecological Niche Factor Analysis (enfa) with the package "adehabitatHS" but before I do so, I want to test the significance of its parameters marginality and tolerance, by using the function niche.test() that runs a Monte Carlo test. I used to do that with the old package "adehabitat" that is now deprecated so I updated all my codes. Everything I want to do seems to work fine except the niche.test() function and I get the error message here below.
> testCro<-niche.test(paramdf, spCro, nrep = 999, o.include = TRUE)
Error in join(pts, ta) : different proj4string in x and xy
I checked the proj4string for x (paramdf) and xy (spCro) and there are exactly identical (see below).
> summary(spCro)
Object of class SpatialPoints
Coordinates:
min max
longitude -124.91 -124.13
latitude 39.86 46.95
Is projected: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0]
Number of points: 84
> summary(paramdf)
Object of class SpatialPixelsDataFrame
Coordinates:
min max
x -125.50000 -123.7998
y 39.50384 47.0000
Is projected: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0]
Number of points: 108237
Grid attributes:
cellcentre.offset cellsize cells.dim
x -125.49517 0.00966 176
y 39.50867 0.00966 776
Data attributes:
bath slope rugo sumT
Min. :-3611.83 Min. : 0.0000 Min. :0.000000 Min. : 1.184
1st Qu.:-1885.11 1st Qu.: 0.5271 1st Qu.:0.008044 1st Qu.: 2.150
Median : -894.61 Median : 1.4974 Median :0.036921 Median : 3.978
Mean :-1157.85 Mean : 3.4237 Mean :0.147369 Mean : 4.794
3rd Qu.: -150.85 3rd Qu.: 4.1152 3rd Qu.:0.197974 3rd Qu.: 7.388
Max. : -0.05 Max. :61.3592 Max. :0.992856 Max. :14.436
[...]
I think I looked for all the help I could find on the internet and didn't find any solution so here is my last chance.
Does anybody have an idea on how to solve this problem?
By the way, I use the R version 3.1.3 and up-to-date "adehabitatHS", "ade4", "sp" and other packages.
Thanks a lot,
Lenaig
≈≈≈≈ ><)))°> <°(((>< ≈≈≈≈
Lenaïg Hemery, Ph. D.
Research Associate - post-doc
Hatfield Marine Science Center
Oregon State University
2030 S.E. Marine Science Drive, Newport, OR 97365, USA
Cell:+1-541-272-7196
More information about the R-help
mailing list