jmsigner / amt

38 stars 13 forks source link

Rename coordinate columns to "x" and "y" in as_ltraj() #61

Closed JoshOBrien closed 2 years ago

JoshOBrien commented 2 years ago

Currently, amt::as_ltraj() produces an "ltraj" object whose coordinate columns have names "x_" and "y_". adehabitatLT::plot.ltraj(), though, expects an "ltraj" object in which the coordinate columns have names "x" and "y" (see code here).

As a result, doing the following fails like so:

library(amt)
library(adehabitatLT)
plot(as_ltraj(deer))
## Error in `[.data.frame`(i, , c("x", "y")) : undefined columns selected

This PR makes the call to plot.ltraj() shown above work, by renaming coordinate columns to "x" and "y" in the methods called by amt::as_ltraj().

jmsigner commented 2 years ago

Thanks for fixing this, much appreciated.

JoshOBrien commented 2 years ago

@jmsigner You bet. Thanks again for making this package available to us all.