Skip to content

Commit 80ad961

Browse files
committed
spelling check + typo + doc
1 parent 6fd2616 commit 80ad961

19 files changed

+121
-71
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- Update to GeoPressureAPI v2 for `geopressure_timeseries()` https://github.com/Rafnuss/GeoPressureR/pull/103/commits/732d1a02cc241dc7d2dde3401c8747fa860650c6
2929
- Fix major bug https://github.com/Rafnuss/GeoPressureR/pull/103/commits/05c3203ef1588bbc1f769050377cadf5f1aadcbd
3030
- Migrate from `httr`to `httr2`
31-
- Fix major bug with saving enviremnt variable in param https://github.com/Rafnuss/GeoPressureR/commit/9bcbf790a7de133448c738db272bf136dc831f8f
31+
- Fix major bug with saving environment variable in param https://github.com/Rafnuss/GeoPressureR/commit/9bcbf790a7de133448c738db272bf136dc831f8f
3232
- Add functions `speed2bearing()` and `windsupport()` https://github.com/Rafnuss/GeoPressureR/commit/fe244f6057db14b6a286c0a77aaaef4c5ec0152c
3333
- Use interpolated `stap_id` for flight instead of `0` https://github.com/Rafnuss/GeoPressureR/commit/d7491c2a5580c9eeafe598935933727489590a75
3434
- Create `edge_add_wind()` https://github.com/Rafnuss/GeoPressureR/commit/36412dc8f0fd061798a701ca632766dbe6f069c8

R/bird_create.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
#' power curve: mass, wing span, wing aspect ratio, and body frontal area.
66
#'
77
#' When any of these variables are missing, we query the
8-
#' \href{https://doi.org/10.6084/m9.figshare.16586228.v5}{AVONET database} using the scientific
9-
#' name from \href{https://www.birds.cornell.edu/clementschecklist/}{the Clements Checklist}.
8+
#' [AVONET database](https://doi.org/10.6084/m9.figshare.16586228.v5) using the scientific
9+
#' name from [the Clements Checklist](https://www.birds.cornell.edu/clementschecklist/).
1010
#'
1111
#'
1212
#' @param scientific_name Scientific name of the species
13-
#' @param mass Mass of the bird in kilograms.
14-
#' @param wing_span Wing span in meters.
15-
#' @param wing_aspect Wing aspect ratio (no unit).
16-
#' @param wing_area Wing area in meter square.
17-
#' @param body_frontal_area Body frontal area in meter square.
13+
#' @param mass Mass of the bird in kilograms
14+
#' @param wing_span Wing span in meters
15+
#' @param wing_aspect Wing aspect ratio (no unit)
16+
#' @param wing_area Wing area in meter square
17+
#' @param body_frontal_area Body frontal area in meter square
1818
#' @param species_name `r lifecycle::badge("deprecated")` Use `scientific_name` instead
1919
#' @importFrom lifecycle deprecated
2020
#' @return List containing mass, wing span, wing aspect ratio, and body frontal area.
@@ -27,7 +27,7 @@
2727
#'
2828
#' # Import your own bird. You will need mass, and at least two of wing_span,
2929
#' # wing_aspect or wing_area.
30-
#' bird_create("custum_bird", mass = 1, wing_span = 1, wing_aspect = 4)
30+
#' bird_create("Madynuss nutshell", mass = 8, wing_span = 0.2, wing_aspect = 4)
3131
#'
3232
#' @family bird
3333
#' @family movement

R/edge_add_wind.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' Reads the NetCDF files and extract the variable requested along each flight defined by the edges.
55
#'
66
#' - Time: linear interpolation using the resolution requested with `rounding_interval`
7-
#' - Space: nearet neighbor interpolation by default or bi-linear with `pracma::interp2` if
7+
#' - Space: nearest neighbour interpolation by default or bi-linear with `pracma::interp2` if
88
#' `interp_spatial_linear=TRUE`
99
#' - Pressure/altitude: linear interpolation using the exact `pressure` values
1010
#'
@@ -20,7 +20,7 @@
2020
#' ](https://bit.ly/3BrwLBM) using the `shortName` notation: `"u"`, `"v"`, `"t"`, `"cc"`, `"r"`,
2121
#' `"w"`, `"ciwc"`, `"clwc"`, `"q"`, `"cswc"`, `"d"`, `"z"`, `"o3"`, `"pv"`, `'vo"`.
2222
#' @param rounding_interval temporal resolution on which to query the variable (min). Default is to
23-
#' macth ERA5 native resolution (1hr).
23+
#' match ERA5 native resolution (1hr).
2424
#' @param interp_spatial_linear logical to interpolate the variable linearly over space, if `FALSE`
2525
#' takes the nearest neighbour. ERA5 native resolution is 0.25°
2626
#' @param return_averaged_variable logical to return the variable for each timestep or average for
@@ -213,7 +213,7 @@ edge_add_wind <- function(
213213
# We assume that the bird is moving with a constant groundspeed between `flight$start` and
214214
# `flight$end`. Using a linear interpolation, we extract the position (lat, lon) at every hour
215215
# on `t_q`. Extrapolation outside (before the bird departure or after he arrived) is with a
216-
# nearest neighbor.
216+
# nearest neighbour.
217217

218218
dlat_se <- (lat_e - lat_s) / fl_s$duration[i_fl]
219219
dlon_se <- (lon_e - lon_s) / fl_s$duration[i_fl]

R/geolight_map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#'
1919
#' Instead of calibrating the twilight errors in terms of duration, we directly model the zenith
2020
#' angle error. We use a kernel distribution to fit the zenith angle during the known stationary
21-
#' period(s). The `twl_calib_adjust` parameter allows to mararnually adjust how smooth you want the
21+
#' period(s). The `twl_calib_adjust` parameter allows to manually adjust how smooth you want the
2222
#' fit of the zenith angle to be. Because the zenith angle error model is fitted with data from the
2323
#' calibration site only, and we are using it for all locations of the bird’s journey, it is safer
2424
#' to assume a broader/smoother distribution.

R/geopressuretemplate.R

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
#' Workflow for GeoPressureR
22
#'
33
#' @description
4-
#' The `geopressuretemplate` function manages the complete workflow for modeling bird trajectories
5-
#' using geospatial pressure and light data. It includes the creation of tag data, likelihood map
6-
#' computation (pressure and/or light), graph model construction, trajectory estimation, and
7-
#' pressure path computation. The function follows a standard structure as defined by the GitHub
8-
#' repository [geopressuretemplate](https://github.com/Rafnuss/GeoPressureTemplate), which
9-
#' separates data and analysis for improved readability, sharability, and reproducibility.
10-
#'
11-
#' @param id A unique identifier for the tag being processed.
12-
#' @param config A configuration object specifying workflow parameters, which is loaded by default
13-
#' using `config::get(config = id)`.
14-
#' @param quiet Logical. If `TRUE`, suppresses informational messages during execution. The default
15-
#' value is `FALSE`.
16-
#' @param file A file path to save the intermediate results (e.g., tag, graph, and pressure paths).
17-
#' Default is `./data/interim/{id}.RData`.
18-
#' @param assert_graph Logical. If `TRUE`, check that the config is compatible for the creation of
19-
#' a graph. The default value is `TRUE`. Set to `FALSE` only if you don't want to create a graph
20-
#' model
21-
#' @param ... Additional parameters to overwrite default or config values. Always prefer to modify
22-
#' `config.yml` if possible.
4+
#' The `geopressuretemplate()` function manages the complete workflow for modelling bird
5+
#' trajectories using geolocator data. It includes the creation `tag` object, the construction of
6+
#' the likelihood maps (pressure and/or light), the creation of the graph model construction, and,
7+
#' finally, the estimation of the trajectory products and the pressure path computation. Read the
8+
#' [Workflow chapter in the GeoPressureManual
9+
#' ](https://raphaelnussbaumer.com/GeoPressureManual/geopressuretemplate-workflow.html) for more
10+
#' information.
11+
#'
12+
#' To be able to run successfully these function, you will need to have correctly set-up the data
13+
#' and configuration files according following the [GeoPressureTemplate standard
14+
#' ](https://raphaelnussbaumer.com/GeoPressureManual/geopressuretemplate-project.html).
15+
#'
2316
#'
2417
#' @details
2518
#' The `geopressuretemplate` function is a high-level entry point that coordinates multiple
26-
#' steps for processing geospatial animal movement data. It relies on underlying child
19+
#' steps for processing the geolocator data and produce trajectories. It relies on underlying child
2720
#' functions for each step:
2821
#'
2922
#' * **Tag Creation [`geopressuretemplate_tag()`]**: Initializes and labels the `tag` object. It
@@ -67,6 +60,19 @@
6760
#' Each of these child functions can be called individually or automatically as part of
6861
#' the `geopressuretemplate` workflow.
6962
#'
63+
#' @param id unique identifier of a tag.
64+
#' @param config configuration object specifying workflow parameters, which is loaded by default
65+
#' using `config::get(config = id)`.
66+
#' @param quiet Logical. If `TRUE`, suppresses informational messages during execution. The default
67+
#' value is `FALSE`.
68+
#' @param file A file path to save the intermediate results (e.g., tag, graph, and pressure paths).
69+
#' Default is `./data/interim/{id}.RData`.
70+
#' @param assert_graph Logical. If `TRUE`, check that the config is compatible for the creation of
71+
#' a graph. The default value is `TRUE`. Set to `FALSE` only if you don't want to create a graph
72+
#' model
73+
#' @param ... Additional parameters to overwrite default or config values. Always prefer to modify
74+
#' `config.yml` if possible.
75+
#'
7076
#'
7177
#' @return
7278
#' The function returns nothing. Instead, it saves the processed outputs (tag, graph,
@@ -75,10 +81,22 @@
7581
#' @examples
7682
#' \dontrun{
7783
#' # Run the complete geopressuretemplate workflow
78-
#' geopressuretemplate("18LX", quiet = TRUE)
84+
#' geopressuretemplate("18LX")
85+
#'
86+
#' # Or run step-by-step
87+
#' # you can check that all the parameters are correctly set in the config file
88+
#' geopressuretemplate_config(id)
89+
#' # 1. creation of the tag
90+
#' tag <- geopressuretemplate_tag("18LX")
91+
#' # 2. creation of the graph
92+
#' geopressuretemplate_graph("18LX")
93+
#' # 3. Computation of the pressurepath
94+
#' geopressuretemplate_pressurepath("18LX")
7995
#' }
8096
#'
8197
#' @family geopressuretemplate
98+
#' @seealso [GeoPressureManual
99+
#' ](https://raphaelnussbaumer.com/GeoPressureManual/geopressuretemplate-workflow.html)
82100
#' @export
83101
geopressuretemplate <- function(
84102
id,

R/geopressureviz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ geopressureviz <- function(x,
118118

119119
names(maps) <- names(maps_choices[maps_is_available])
120120

121-
# Set color of each stationary period
121+
# Set colour of each stationary period
122122
col <- rep(RColorBrewer::brewer.pal(8, "Dark2"), times = ceiling(nrow(tag$stap) / 8))
123123
tag$stap$col <- col[tag$stap$stap_id]
124124
tag$stap$duration <- stap2duration(tag$stap)

R/map_create.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @param stap a data.frame of stationary periods.
1212
#' @inheritParams tag_create
1313
#' @param type type of data one of `"unknown"`,`"pressure"`, `"light"`, `"pressure_mse"`,
14-
#' `"water_mask"`, `"pressure_mask"`, `"marginal"`. Allows for custom color palette on plot.
14+
#' `"water_mask"`, `"pressure_mask"`, `"marginal"`. Allows for custom colour palette on plot.
1515
#'
1616
#' @return A GeoPressure `map` object is returned
1717
#'

R/plot.tag.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ plot_tag_twilight <- function(tag,
531531
twl$discard <- FALSE
532532
}
533533

534-
# plotly doesn't like much changing color...
534+
# plotly doesn't like much changing colour...
535535
if (plot_plotly) {
536536
p <- p +
537537
ggplot2::geom_point(

R/speed2bearing.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#'
33
#' @description
44
#' This function convert a speed vector represented in complex number into a bearing angle (0°=N ;
5-
#' 90°=E...). This conversion is needed because trigonomtric angle are different than bearing.
5+
#' 90°=E...). This conversion is needed because trigonometric angle are different than bearing.
66
#'
77
#' @param speed speed as complex value
88
#' @param speed_ref reference vector of the angle. Default is the North in order to return bearing.
9-
#' Normal trigonometriy should be `speed_ref = 1`
9+
#' Use `speed_ref = 1` for trigonometric orientation (clockwise from East).
1010
#' @param positive logical to ensure the bearing is positive between 0-360 degree.
1111
#'
1212
#' @return bearing angle in degree

R/tag_create.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' @description
44
#' Create a GeoPressureR `tag` object from the data collected by a tracking device. The function
5-
#' can read data formatted according to three manufacturers SOI, Migratetech or Lun CAnMove, as
5+
#' can read data formatted according to three manufacturers SOI, Migratetech or Lund CAnMove, as
66
#' well as according to the GeoLocator Data package standard and also accept manual data.frame as
77
#' input. Pressure data is required for the GeoPressureR workflow but can be allowed to be missing
88
#' with `assert_pressure = FALSE`.
@@ -85,7 +85,8 @@
8585
#' (i.e. jiggle). In the SOI sensor, it is summarised from 32 measurements at 10Hz
8686
#' - `pitch` is the relative position of the bird’s body relative to the z axis. In the SOI
8787
#' sensor, it is an average over 32 measurements at 10Hz.
88-
#' - `magnetic` (optional) data.frame with columns: `date`, `mX`, `mY`, `mZ`, `gX`, `gY` and `gZ`
88+
#' - `magnetic` (optional) data.frame with columns: `date`, `magnetic_x`, `magnetic_y`, `magnetic_z`
89+
#' , `acceleration_x`, `acceleration_y` and `acceleration_z`
8990
#'
9091
#' @examples
9192
#' withr::with_dir(system.file("extdata", package = "GeoPressureR"), {

0 commit comments

Comments
 (0)