-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return lat_plot and lon_plot coordinates using make_2d_grid()
- Loading branch information
1 parent
9abcc83
commit 67d4c7d
Showing
5 changed files
with
106 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: akgfmaps | ||
Type: Package | ||
Title: Alaska Groundfish and Ecosystem Survey Area Mapping | ||
Version: 3.2.0 | ||
Version: 3.3.0 | ||
Authors@R: c(person("Sean", "Rohan", email = "[email protected]", role = c("aut", "cre")), | ||
person("Jason", "Conner", email = "[email protected]", role = "ctb"), | ||
person("Liz", "Dawson", email = "[email protected]", role = "ctb"), | ||
|
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,32 @@ | ||
# Return coordinates for plotting gridded data using make_2d_grid() | ||
|
||
This example show how to use the make_2d_grid() function to produce grid cell centroid | ||
coordinates that facilitate plotting data from 2d grids that are used for spatial | ||
analyses (e.g. using VAST or sdmTMB). Otherwise this would require post-processing | ||
manipulation of gridded data. | ||
|
||
The plotting coordinate columns (lon_plot and lat_plot) should only be used for | ||
visualization. | ||
|
||
``` r | ||
library(akgfmaps) | ||
|
||
ebs_layers <- akgfmaps::get_base_layers(select.region = "sebs", | ||
set.crs = "EPSG:3338") | ||
|
||
ebs_grid <- akgfmaps:::make_2d_grid(obj = ebs_layers$survey.strata, | ||
resolution = res, | ||
bbox = vast_bbox, | ||
output_type = "point", | ||
include_tile_center = TRUE) | ||
|
||
p1 <- ggplot() + | ||
geom_tile(data = ebs_grid, | ||
mapping = aes(x = lon_plot, | ||
y = lat_plot, | ||
fill = Stratum)) | ||
|
||
p1 | ||
``` | ||
|
||
![](/assets/ex_2d_grid_with_plot_centroids.png) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.