Skip to content

Commit 4ef3543

Browse files
author
marlonecobos
committed
added or improved usage to function documentation
1 parent af03151 commit 4ef3543

File tree

6 files changed

+60
-70
lines changed

6 files changed

+60
-70
lines changed

R/organize_for_projection.R

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
#' making the variables properly organized for modeling projections.
1010
#' See **Details** for more information.
1111
#'
12-
#' @usage organize_for_projection(output_dir, models = NULL,
13-
#' variable_names = NULL,
14-
#' categorical_variables = NULL,
15-
#' present_file = NULL,
16-
#' past_files = NULL, past_period = NULL,
17-
#' past_gcm = NULL, future_files = NULL,
18-
#' future_period = NULL, future_pscen = NULL,
19-
#' future_gcm = NULL, static_variables = NULL,
20-
#' check_extent = TRUE,
21-
#' resample_to_present = TRUE, mask = NULL,
22-
#' overwrite = FALSE)
12+
#' @usage
13+
#' organize_for_projection(output_dir, models = NULL, variable_names = NULL,
14+
#' categorical_variables = NULL, present_file = NULL,
15+
#' past_files = NULL, past_period = NULL,
16+
#' past_gcm = NULL, future_files = NULL,
17+
#' future_period = NULL, future_pscen = NULL,
18+
#' future_gcm = NULL, static_variables = NULL,
19+
#' check_extent = TRUE, resample_to_present = TRUE,
20+
#' mask = NULL, overwrite = FALSE)
2321
#'
2422
#' @param output_dir (character) path to the folder where the organized data
2523
#' will be saved.

R/prediction_changes.R

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
#' Compute changes of suitable areas between scenarios (single scenario / GCM)
1+
#' Compute changes of suitable areas in other scenarios (single scenario / GCM)
2+
#'
3+
#' @usage
4+
#' prediction_changes(current_predictions, new_predictions,
5+
#' predicted_to = "future", fitted_models = NULL,
6+
#' consensus = "mean", user_threshold = NULL,
7+
#' force_resample = FALSE, gain_color = "#009E73",
8+
#' loss_color = "#D55E00", stable_suitable = "#0072B2",
9+
#' stable_unsuitable = "grey", write_results = FALSE,
10+
#' output_dir = NULL, overwrite = FALSE,
11+
#' write_bin_models = FALSE)
212
#'
313
#' @param current_predictions (SpatRaster) A `SpatRaster` object returned by
414
#' `predict_selected()` with suitability predicted under current conditions.
@@ -99,6 +109,7 @@
99109
#' predicted_to = "future")
100110
#' # Plot result
101111
#' terra::plot(p_changes)
112+
102113
prediction_changes <- function(current_predictions,
103114
new_predictions,
104115
predicted_to = "future",
@@ -113,7 +124,7 @@ prediction_changes <- function(current_predictions,
113124
write_results = FALSE,
114125
output_dir = NULL,
115126
overwrite = FALSE,
116-
write_bin_models = FALSE){
127+
write_bin_models = FALSE) {
117128
#### Check data ####
118129
if (missing(current_predictions)) {
119130
stop("Argument 'current_predictions' must be defined.")

R/single_mop.R

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
#' represent dissimilarities and non-analogous conditions when comparing a set
66
#' of reference conditions (M) against another set of scenario conditions (G).
77
#'
8+
#' @usage
9+
#' single_mop(data, new_variables, subset_variables = FALSE,
10+
#' mask = NULL, type = "basic", na_in_range = TRUE,
11+
#' calculate_distance = FALSE, where_distance = "in_range",
12+
#' distance = "euclidean", scale = FALSE, center = FALSE,
13+
#' fix_NA = TRUE, percentage = 1, comp_each = 2000, tol = NULL,
14+
#' rescale_distance = FALSE, parallel = FALSE, ncores = NULL,
15+
#' progress_bar = TRUE, write_files = FALSE, out_dir = NULL,
16+
#' overwrite = FALSE)
17+
#'
818
#' @param data an object of class `fitted_models` returned by the
919
#' [fit_selected()] function, an object of class `prepared_data` returned by
1020
#' the [prepare_data()] function, or an object of class `calibration_results`
@@ -160,7 +170,7 @@
160170
#' # Run MOP
161171
#' sm <- single_mop(data = fitted_model_maxnet, new_variables = future_scenario,
162172
#' type = "detailed")
163-
#'
173+
164174
single_mop <- function(data,
165175
new_variables,
166176
subset_variables = FALSE,
@@ -182,7 +192,7 @@ single_mop <- function(data,
182192
progress_bar = TRUE,
183193
write_files = FALSE,
184194
out_dir = NULL,
185-
overwrite = FALSE){
195+
overwrite = FALSE) {
186196

187197
#Check data
188198
if (missing(data)) {

man/organize_for_projection.Rd

Lines changed: 8 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/prediction_changes.Rd

Lines changed: 10 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/single_mop.Rd

Lines changed: 8 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)