generated from bluegreen-labs/R_project_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:bluegreen-labs/skytrackr # Conflicts: # R/skytrackr.R # analysis/demo_analysis.R
- Loading branch information
Showing
14 changed files
with
199 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#' Plot skytrackr results | ||
#' | ||
#' Create a map of estimated locations | ||
#' | ||
#' @param df a data frame with locations produced by skytrackr() | ||
#' @param buffer a land mask buffer value | ||
#' @param bbox a bounding box | ||
#' | ||
#' @return a ggplot map of tracked locations | ||
#' @export | ||
|
||
stk_map <- function(df, buffer, bbox) { | ||
p <- ggplot2::ggplot(df) + | ||
ggplot2::geom_sf( | ||
data = stk_mask(buffer = buffer) | ||
) + | ||
ggplot2::geom_sf( | ||
data = stk_mask(buffer = 0) | ||
) + | ||
ggplot2::labs( | ||
x = "", | ||
y = "" | ||
) | ||
|
||
if(nrow(df) > 1) { | ||
p <- p + | ||
ggplot2::geom_path( | ||
aes( | ||
longitude, | ||
latitude | ||
) | ||
) | ||
} | ||
|
||
p <- p + | ||
ggplot2::geom_point( | ||
aes( | ||
longitude, | ||
latitude | ||
) | ||
) + | ||
ggplot2::coord_sf( | ||
xlim = c(bbox[1], bbox[3]), | ||
ylim = c(bbox[2], bbox[4]) | ||
) + | ||
ggplot2::theme_bw() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Run all unit tests | ||
|
||
# This is a wrapper around all the tests specified | ||
# in the tests/testthat directory. These tests are visible | ||
# to users and serve as small examples as well. | ||
testthat::test_check("skytrackr") |
Oops, something went wrong.