Code Monkey home page Code Monkey logo

recurse's Issues

error in getRecursions "Not compatible with requested type" that can not be debugged

I am getting an error when calling getRecursions using a data.frame. I have tried to debug by looking at the source code but can not determine the error. The data should work in the function. See below.

head(tmp)
x y t id
13045 672819 5536219 2015-03-08 01:02:00 57A.2015
86033 694654 5523683 2015-03-08 03:00:00 57A.2015
30737 695160 5523393 2015-03-08 03:02:00 57A.2015
86035 698207 5521674 2015-03-08 05:02:00 57A.2015
4911 694639 5523749 2015-03-08 06:00:00 57A.2015
5398 694549 5523802 2015-03-08 06:02:00 57A.2015

sapply(tmp, class)
$x
[1] "numeric"

$y
[1] "numeric"

$t
[1] "POSIXlt" "POSIXt"

$id
[1] "character"

recurse::getRecursions(tmp, radius=100)

Error in getRecursionsCpp(x[, 1], x[, 2], x[, 3], x[, 4], x[, 1], x[, :Not compatible with requested type: [type=list; target=double].

Error with getRecursionsInPolygon - if (isNewTrack[j]) { : missing value where TRUE/FALSE needed

Hi,

I am trying to use the getRecursionsInPolygon() function, but I keep getting the following error (and additional warning):

Error in if (isNewTrack[j]) { : missing value where TRUE/FALSE needed
In addition: Warning message:
In diff(as.numeric(trajectory[, idIdx])) : NAs introduced by coercion

Am I failing in providing something that the function needs?

I am providing a data.frame with locations and timestamps, as required:

         x       y           timestamp  id
1 501658.0 4290020 2020-10-18 17:55:00 tag
2 505927.4 4293400 2020-10-18 18:25:00 tag
3 505914.5 4293368 2020-10-18 18:55:00 tag
4 499876.1 4287707 2020-10-18 10:25:00 tag
5 499794.4 4287576 2020-10-18 10:55:00 tag
6 499790.5 4287579 2020-10-18 11:25:00 tag
...

Similarly, I am providing a SpatialPolygons object such as:

An object of class "SpatialPolygons"
Slot "polygons":
[[1]]
An object of class "Polygons"
Slot "Polygons":
[[1]]
An object of class "Polygon"
Slot "labpt":
[1]  503510.9 4294866.7

Slot "area":
[1] 32165780

Slot "hole":
[1] FALSE

Slot "ringDir":
[1] 1

Slot "coords":
         [,1]    [,2]
[1,] 503886.7 4298520
[2,] 507815.9 4294444
[3,] 502844.6 4291035
[4,] 499396.6 4295706
[5,] 503886.7 4298520



Slot "plotOrder":
[1] 1

Slot "labpt":
[1]  503510.9 4294866.7

Slot "ID":
[1] "ID1"

Slot "area":
[1] 32165780



Slot "plotOrder":
[1] 1

Slot "bbox":
        min       max
x  499396.6  507815.9
y 4291034.9 4298519.7

Slot "proj4string":
CRS arguments: +proj=utm +zone=29 +ellps=WGS84 

Thank you in advance!

dependency on retiring spatial infrastructure packages

You will be aware, for example from:
https://r-spatial.org/r/2022/04/12/evolution.html,
https://r-spatial.org/r/2022/12/14/evolution2.html,
https://r-spatial.org/r/2023/04/10/evolution3.html and
https://rsbivand.github.io/csds_jan23/bivand_csds_ssg_230117.pdf and
perhaps view https://www.youtube.com/watch?v=TlpjIqTPMCA&list=PLzREt6r1NenmWEidssmLm-VO_YmAh4pq9&index=1
that rgdal, rgeos and maptools will be retired this
year, in October 2023.

recurse suggests rgeos but does not pass CMD check when rgeos is absent:
00check.log
Here CMD check was run in a scenario using sp evolution status 2 (substitute use of rgdal with sf for projection/transformation/CRS) and absence of retiring packages from the library path. Possibly the geos package would provide mitigations; see also links from https://r-spatial.org/r/2023/04/10/evolution3.html for further hints. Please fix best by June, latest October 2023.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.