-
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.
- Loading branch information
Showing
14 changed files
with
29,122 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,14 @@ knitr::opts_chunk$set( | |
# geoprofiler | ||
|
||
<!-- badges: start --> | ||
|
||
[![R-CMD-check](https://github.com/tobiste/geoprofiler/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tobiste/geoprofiler/actions/workflows/R-CMD-check.yaml) | ||
|
||
<!-- badges: end --> | ||
|
||
The goal of geoprofiler is to get distances along and across user-defined | ||
profile lines or transects. This is useful when variables depend on distances. | ||
The goal of geoprofiler is to get distances along and across user-defined profile lines or transects. This is useful when variables depend on distances. | ||
|
||
![Concept](man/figures/fig.png) | ||
|
||
## Installation | ||
|
||
|
@@ -41,12 +44,14 @@ library(ggplot2) | |
``` | ||
|
||
Import example data and transfer them into a `sf` object: | ||
|
||
```{r quakes} | ||
data(quakes) | ||
quakes_sf <- sf::st_as_sf(quakes, coords = c("long", "lat"), crs = "WGS84") | ||
``` | ||
|
||
Create a profile line from two known points: | ||
|
||
```{r profile} | ||
profile <- data.frame(lon = c(160, -170), lat = c(-15, -30)) |> | ||
sf::st_as_sf(coords = c("lon", "lat"), crs = "WGS84") |> | ||
|
@@ -57,12 +62,14 @@ profile <- data.frame(lon = c(160, -170), lat = c(-15, -30)) |> | |
> Note: You can also create a profile line by a direction via `profile_points()` | ||
Calculate the distances of all points along and across the profile line: | ||
|
||
```{r cooridnates} | ||
quakes_profile <- profile_coords(quakes_sf, profile = profile) |> | ||
dplyr::bind_cols(quakes_sf) | ||
``` | ||
|
||
Finally, create your profile plot: | ||
|
||
```{r plot} | ||
ggplot(quakes_profile, aes(X, depth, color = mag, size = abs(Y), alpha = abs(Y))) + | ||
geom_point() + | ||
|
@@ -77,20 +84,16 @@ ggplot(quakes_profile, aes(X, depth, color = mag, size = abs(Y), alpha = abs(Y)) | |
|
||
## Documentation | ||
|
||
The detailed documentation can be found at | ||
https://tobiste.github.io/geoprofiler/articles/geoprofiler.html | ||
|
||
The detailed documentation can be found at <https://tobiste.github.io/geoprofiler/articles/geoprofiler.html> | ||
|
||
## Author | ||
|
||
Tobias Stephan (<[email protected]>) | ||
Tobias Stephan ([tstephan\@lakeheadu.ca](mailto:[email protected]){.email}) | ||
|
||
## Feedback, issues, and contributions | ||
|
||
I welcome feedback, suggestions, issues, and contributions! If you have | ||
found a bug, please file it | ||
[here](https://github.com/tobiste/geoprofiler/issues) with minimal code to | ||
reproduce the issue. | ||
I welcome feedback, suggestions, issues, and contributions! If you have found a bug, please file it [here](https://github.com/tobiste/geoprofiler/issues) with minimal code to reproduce the issue. | ||
|
||
## License | ||
|
||
MIT License |
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
Oops, something went wrong.