Skip to content

Commit

Permalink
Resolve (new) issue with data slot in SpatialPointsDataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardlavender committed Aug 27, 2023
1 parent 0698764 commit 0b965aa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions R/get_detections.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ get_detection_pr <- function(distance = 1:1000,
#' proj_wgs84
#' )
#' xy <- sp::spTransform(xy, proj_utm)
#' xy@data <- as.data.frame(xy)
#'
#' #### Example (1): Get the simplest containers around receivers
#' get_detection_containers(xy)
Expand Down Expand Up @@ -222,6 +223,8 @@ get_detection_containers <- function(xy,
#' proj_wgs84
#' )
#' xy <- sp::spTransform(xy, proj_utm)
#' xy@data <- as.data.frame(xy)
#' rownames(xy@data) <- dat_moorings$receiver_id
#' ## Get receiver-specific detection containers
#' # ... via get_detection_containers with byid = TRUE
#' containers <- get_detection_containers(xy, byid = TRUE)
Expand All @@ -232,7 +235,7 @@ get_detection_containers <- function(xy,
#' "receiver_start_date",
#' "receiver_end_date"
#' )]
#' row.names(containers_df) <- names(containers)
#' row.names(containers_df) <- dat_moorings$receiver_id
#' containers <- sp::SpatialPolygonsDataFrame(containers, containers_df)
#'
#' ## Simulate some receiver 'servicing' dates for demonstration purposes
Expand Down Expand Up @@ -882,6 +885,7 @@ get_id_rec_overlap <- function(ids,
#' proj_wgs84
#' )
#' xy <- sp::spTransform(xy, proj_utm)
#' xy@data <- as.data.frame(xy)
#'
#' #### Example (1): Extract all depth values within each receiver's container
#' depths_by_container <-
Expand Down Expand Up @@ -1420,14 +1424,16 @@ get_detection_clumps <-
#' proj_wgs84
#' )
#' xy <- sp::spTransform(xy, proj_utm)
#' xy@data <- as.data.frame(xy)
#' rownames(xy@data) <- dat_moorings$receiver_id
#' # Get receiver-specific detection containers
#' containers <- get_detection_containers(xy, byid = TRUE)
#' containers_df <- dat_moorings[, c(
#' "receiver_id",
#' "receiver_start_date",
#' "receiver_end_date"
#' )]
#' row.names(containers_df) <- names(containers)
#' row.names(containers_df) <- dat_moorings$receiver_id
#' containers <- sp::SpatialPolygonsDataFrame(containers, containers_df)
#' # Define detection container overlaps
#' overlaps <- get_detection_containers_overlap(containers = containers)
Expand Down
1 change: 1 addition & 0 deletions man/get_detection_containers.Rd

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

1 change: 1 addition & 0 deletions man/get_detection_containers_envir.Rd

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

4 changes: 3 additions & 1 deletion man/get_detection_containers_overlap.Rd

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

4 changes: 3 additions & 1 deletion man/get_detection_overlaps.Rd

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

0 comments on commit 0b965aa

Please sign in to comment.