Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
mhpob committed Jul 2, 2024
1 parent 50fb228 commit 38409a3
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion R/leaflet_graph.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
#' Plot the leaflet graphs for detection and individual
#' Plot leaflet graphs for detection and individual
#'
#' @param station_spatial sf spatial data/frame created by prep_station_spatial
#'
#' @examples
#' \dontrun{
#' # Get some data
#' td <- file.path(tempdir(), "matos_test_files")
#' dir.create(td)
#'
#' ## Get an extract file
#' download.file(
#' paste0(
#' "https://members.oceantrack.org/data/repository/",
#' "pbsm/detection-extracts/pbsm_matched_detections_2018.zip/",
#' "@@download/file"
#' ),
#' destfile = file.path(td, "pbsm_matched_detections_2018.zip"),
#' mode = "wb"
#' )
#' unzip(file.path(td, "pbsm_matched_detections_2018.zip"),
#' exdir = td
#' )
#'
#' matched_dets <- data.table::fread(
#' file.path(td, "pbsm_matched_detections_2018.csv")
#' )
#'
#' # Convert to spatial
#' station_spatial <- prep_station_spatial(matched_dets, "tag")
#'
#' # Create leaflet map
#' leaflet_graph(station_spatial)
#' }
#'
#' @export

leaflet_graph <- function(station_spatial) {
Expand Down

0 comments on commit 38409a3

Please sign in to comment.