Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mhpob authored Jul 2, 2024
2 parents 211106b + 992c34a commit 011635a
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [main, dev]

concurrency:
group: rcmdcheck-${{ github.ref }}
cancel-in-progress: true

name: R-CMD-check

jobs:
Expand Down Expand Up @@ -46,4 +50,5 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"note"'
upload-snapshots: true
2 changes: 2 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw", "**.[rR]profile"]
pull_request:
paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw", "**.[rR]profile"]

name: Style

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: otndo
Title: Understand your OTN data
Version: 0.2.2
Version: 0.2.3.9000
Authors@R:
person("Michael", "O'Brien", , "mike@obrien.page", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1420-6395"))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## otndo 0.2
### v 0.2.3
* Switched from using the `mapview` package for interactive maps to `leaflet` and `leaflet_legend`. Thanks to [@joyliujoyliu](https://github.com/joyliujoyliu) for their work here!

### v 0.2.2
* Fixed behavior where `clean_otn_deployment` would return different columns if there was no internal transmitter logged. [Issue #10](https://github.com/mhpob/otndo/issues/10); [d58e2d4](https://github.com/mhpob/otndo/pull/31/commits/d58e2d46e05aed7ba4acc08b8d02672b28d79804)
* Add internal function (`convert_times`) that checks for Excel-formatted date-times and converts accordingly [f13f360](https://github.com/mhpob/otndo/pull/31/commits/f13f360fe5e4438b6ba668039a6c94f04eeafe60)
Expand Down
57 changes: 31 additions & 26 deletions R/leaflet_graph.R
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
#' Plot the leaflet graphs for detection and individual
#' @param station_spatial is created by prep_station_spatial,which is a spatial object with the geometry
#'
#' @param station_spatial sf spatial data/frame created by prep_station_spatial
#'
#' @export

leaflet_graph <- function(station_spatial) {
geometry<- NULL
df <- station_spatial |> tidyr::extract(geometry, c('lon', 'lat'), '\\((.*), (.*)\\)', convert = TRUE)
numPal <- leaflet::colorNumeric('viridis', df $Detections)
geometry <- NULL
df <- station_spatial |> tidyr::extract(geometry, c("lon", "lat"), "\\((.*), (.*)\\)", convert = TRUE)
numPal <- leaflet::colorNumeric("viridis", df$Detections)
leaflet::leaflet(data = df) |>
leaflet::addTiles() |>
leaflet::addCircleMarkers( lat = ~lat, lng = ~lon,
color= 'black', fillColor = ~numPal(df$Detections),fillOpacity = 0.7,
popup = paste("Station ", df$station , "<br>",
"PI:", df$PI, "<br>",
"Detections:", df$Detections, "<br>",
"detectedby:", df$detectedby, "<br>",
"Individuals:", df$Individuals),
radius = ~(df$Individuals)) |>

leaflet::addCircleMarkers(
lat = ~lat, lng = ~lon,
color = "black",
fillColor = ~ numPal(Detections),
fillOpacity = 0.7,
popup = paste(
"Station ", df$station, "<br>",
"PI:", df$PI, "<br>",
"Detections:", df$Detections, "<br>",
"detectedby:", df$detectedby, "<br>",
"Individuals:", df$Individuals
),
radius = ~ Individuals
) |>
leaflegend::addLegendSize(
values = df $Individuals,
values = df$Individuals,
baseSize = 5,
color = 'black',
title = 'Individual',
shape = 'circle',
orientation = 'horizontal',
opacity = .5,
color = "black",
title = "Individual",
shape = "circle",
orientation = "horizontal",
opacity = 0.5,
fillOpacity = 0,
breaks = 5,
position = 'bottomright') |>
position = "bottomright"
) |>
leaflegend::addLegendNumeric(
pal = numPal,
title = 'Matched Detection',
title = 'Matched Detections',
values = df$Detections,
fillOpacity = .5,
decreasing = FALSE,
orientation = 'horizontal',
shape = 'rect',
position = 'bottomright',
height = 20,
width = 100)



width = 100
)
}

3 changes: 3 additions & 0 deletions R/match_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#'
#' @examples
#' \dontrun{
#' td <- file.path(tempdir(), "matos_test_files")
#' dir.create(td)
#'
#' # Receiver
#' download.file(
#' paste0(
Expand Down
3 changes: 3 additions & 0 deletions R/matched_abacus.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#'
#' @examples
#' \dontrun{
#' td <- file.path(tempdir(), "matos_test_files")
#' dir.create(td)
#'
#' # Get a detection file
#' download.file(
#' paste0(
Expand Down
3 changes: 3 additions & 0 deletions R/prep_station_spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#'
#' @examples
#' \dontrun{
#' td <- file.path(tempdir(), "matos_test_files")
#' dir.create(td)
#'
#' # Get an extract file
#' download.file(
#' paste0(
Expand Down
2 changes: 1 addition & 1 deletion R/remaining_transmitters.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @examples
#' \dontrun{
#' #' # Set up example data
#' # Set up example data
#' td <- file.path(tempdir(), "otndo_example")
#' dir.create(td)
#'
Expand Down

0 comments on commit 011635a

Please sign in to comment.