Skip to content

Commit

Permalink
Merge branch 'dev' into dev-declare-globals
Browse files Browse the repository at this point in the history
  • Loading branch information
mhpob committed May 11, 2024
2 parents b6cff76 + d3681b6 commit 6d54ac3
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 73 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: glatos
Type: Package
Title: A package for the Great Lakes Acoustic Telemetry Observation System
Description: Functions useful to members of the Great Lakes Acoustic Telemetry Observation System https://glatos.glos.us; many more broadly relevant to simulating, processing, analysing, and visualizing acoustic telemetry data.
Version: 0.8.0.9004
Date: 2024-02-16
Version: 0.8.0.9005
Date: 2024-04-09
Depends: R (>= 3.5.0)
Imports:
av,
Expand Down
29 changes: 29 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,35 @@
using VDAT.exe (e.g., using `vdat_convert()`).


# glatos 0.7.3 (2024-04-09)


### Bug fixes

- Fixed bug in `summarize_detections()` where values in `num_locs` and
`locations` columns were incorrect.
- Likely a side effect of
[commit 3f0a2ee](https://github.com/ocean-tracking-network/glatos/commit/3f0a2ee366d8c9447bf4b0bff0a1f8dbfd3819a6)
which aimed to fix [issue #182](https://github.com/ocean-tracking-network/glatos/issues/182)


----


# glatos 0.7.2 (2024-02-25)


### Bug fixes


- Fixed bug in `summarize_detections()` where value in `locations` output
column was name of input column (e.g. "glatos_array"), rather than values
from that column (e.g., "AGR", "BBI").
- fixed [issue #182](https://github.com/ocean-tracking-network/glatos/issues/182)
- cherry-picked from [commit db9d69a]( https://github.com/ocean-tracking-network/glatos/commit/db9d69a3d08a97e7b8f86e0d4977aa0909776ddd)
which was merged with dev but not main.


----

# glatos 0.7.1 (2024-01-19)
Expand Down
17 changes: 9 additions & 8 deletions R/summ-summarize_detections.r
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@
#'
#' @export



summarize_detections <- function(det, location_col = "glatos_array",
receiver_locs = NULL, animals = NULL,
summ_type = "animal") {
Expand Down Expand Up @@ -285,10 +283,13 @@ summarize_detections <- function(det, location_col = "glatos_array",
loc_summary[is.na(num_fish), `:=`(num_fish = 0, num_dets = 0)]

# reorder columns
data.table::setcolorder(loc_summary, c(
setdiff(names(loc_summary), "animals"),
"animals"
))
data.table::setcolorder(
loc_summary,
c(
setdiff(names(loc_summary), "animals"),
"animals"
)
)

data.table::setkeyv(loc_summary, location_col)

Expand All @@ -298,11 +299,11 @@ summarize_detections <- function(det, location_col = "glatos_array",
if (summ_type == "animal") {
# summarize fish detections
anim_summary <- dtc[, list(
num_locs = data.table::uniqueN(location_col),
num_locs = data.table::uniqueN(.SD[[location_col]]),
num_dets = .N,
first_det = min(detection_timestamp_utc),
last_det = max(detection_timestamp_utc),
locations = paste(sort(unique(dtc[[location_col]])), collapse = " ")
locations = paste(sort(unique(.SD[[location_col]])), collapse = " ")
),
by = animal_id
]
Expand Down
117 changes: 54 additions & 63 deletions man/summarize_detections.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d54ac3

Please sign in to comment.