hugomflavio / actel

Standardised analysis of acoustic telemetry data from fish moving through receiver arrays
https://hugomflavio.github.io/actel-website
26 stars 6 forks source link

Migration: Error in apply(x, 1, function(i) i[1] != i[2]): dim(X) must have a positive length #113

Closed hugomflavio closed 1 month ago

hugomflavio commented 1 month ago

Brought up by Simon Dedman.

Traceback:

4: stop("dim(X) must have a positive length")
3: apply(x, 1, function(i) i[1] != i[2])
2: checkIssue79(arrays, spatial)
1: actel::migration(tz = NULL, section.order = NULL, datapack = mypreload, 
       success.arrays = NULL, max.interval = 60, min.total.detections = 2, 
       min.per.event = 1, start.time = NULL, stop.time = NULL, speed.method = c("last to first", 
           "last to last", "first to first"), speed.warning = NULL, 
       speed.error = NULL, jump.warning = 2, jump.error = 3, inactive.warning = NULL, 
       inactive.error = NULL, exclude.tags = NULL, override = NULL, 
       report = TRUE, auto.open = TRUE, discard.orphans = FALSE, 
       discard.first = NULL, save.detections = FALSE, if.last.skip.section = TRUE, 
       replicates = NULL, disregard.parallels = TRUE, GUI = c("needed", 
           "always", "never"), save.tables.locally = FALSE, print.releases = TRUE, 
       detections.y.axis = c("auto", "stations", "arrays"))

Happened while using a preload object. preload object sent to me by email

hugomflavio commented 1 month ago

@SimonDedman This bug is now fixed. Thanks for reporting it!

You can obtain the fix by installing the latest dev version:

# If you don't have the package "remotes" installed, start with:
install.packages("remotes")

# This will install actel's development version:
remotes::install_github("hugomflavio/actel"
                        build_opts = c("--no-resave-data", "--no-manual"), 
                        build_vignettes = TRUE)

library("actel")
# The displayed version should now be 1.3.0.9009 (or higher)
# If that is not the case, unload actel and load it again.