dplR icon indicating copy to clipboard operation
dplR copied to clipboard

Conflict with corr.rwl.seg() class "crs" and sf package class "crs" (coordinate reference system)

Open ctmaher opened this issue 1 year ago • 6 comments

Hi Andy and dplR crew,

I came across an issue using corr.rwl.seg() with the sf ("simple features") package loaded.

I got this error when I ran corr.rwl.seg(): "Coordinate Reference System: Error: invalid crs object: wrong length"

I think it is related to this line near the end of the corr.rwl.seg() code: class(res) <- c("list", "crs")

In the sf package, class "crs" is a coordinate reference system (like class "CRS" in the sp package).

Here's a simple way to test this:

library(dplR) data("ca533") corr.rwl.seg(ca533) # works fine

load the sf package

library(sf) corr.rwl.seg(ca533) # throws the error

Cheers,

Colin

ctmaher avatar Mar 15 '23 01:03 ctmaher