prioritizr / prioritizr
Showing 15 of 79 files from the diff.
Newly tracked file
R/category_vector.R changed.
Newly tracked file
R/add_linear_penalties.R changed.
Newly tracked file
R/add_feature_weights.R changed.
Newly tracked file
R/zones.R changed.
Newly tracked file
R/distribute_load.R changed.
Newly tracked file
R/solve.R changed.
Newly tracked file
R/parameters.R changed.
Other files ignored by Codecov
docs/pkgdown.yml has changed.
man/solve.Rd has changed.
man/zones.Rd has changed.

@@ -4,7 +4,7 @@
Loading
4 4
#' Category vector
5 5
#'
6 6
#' Convert an object containing binary (`integer`) fields (columns) into a
7 -
#' `integer` `vector` indicating the column index where each row is
7 +
#' `integer` vector indicating the column index where each row is
8 8
#' `1`.
9 9
#'
10 10
#' @param x `matrix`, `data.frame`, [`Spatial-class`],
@@ -15,7 +15,7 @@
Loading
15 15
#'   value of zero. Also, note that in the argument to `x`, each row must
16 16
#'   contain only a single value equal to `1`.
17 17
#'
18 -
#' @return `integer` `vector`
18 +
#' @return `integer` vector.
19 19
#'
20 20
#' @seealso [base::max.col()]
21 21
#'

@@ -14,7 +14,7 @@
Loading
14 14
#' @param budget `numeric` value specifying the maximum expenditure of
15 15
#'   the prioritization. For problems with multiple zones, the argument
16 16
#'   to `budget` can be a single `numeric` value to specify a budget
17 -
#'   for the entire solution or a `numeric` `vector` to specify
17 +
#'   for the entire solution or a `numeric` vector to specify
18 18
#'   a budget for each each management zone.
19 19
#'
20 20
#' @details

@@ -35,11 +35,11 @@
Loading
35 35
#'
36 36
#' \describe{
37 37
#'
38 -
#' \item{`data` as an `integer` `vector`}{containing indices that indicate which
38 +
#' \item{`data` as an `integer` vector}{containing indices that indicate which
39 39
#'   planning units should be locked for the solution. This argument is only
40 40
#'   compatible with problems that contain a single zone.}
41 41
#'
42 -
#' \item{`data` as a `logical` `vector`}{containing `TRUE` and/or
42 +
#' \item{`data` as a `logical` vector}{containing `TRUE` and/or
43 43
#'   `FALSE` values that indicate which planning units should be locked
44 44
#'   in the solution. This argument is only compatible with problems that
45 45
#'   contain a single zone.}
@@ -52,7 +52,7 @@
Loading
52 52
#'   zone. Thus each row should only contain at most a single `TRUE`
53 53
#'   value.}
54 54
#'
55 -
#' \item{`data` as a `character` `vector`}{containing field (column) name(s)
55 +
#' \item{`data` as a `character` vector}{containing field (column) name(s)
56 56
#'   that indicate if planning units should be locked for the solution.
57 57
#'   This format is only
58 58
#'   compatible if the planning units in the argument to `x` are a

@@ -41,7 +41,7 @@
Loading
41 41
#'
42 42
#' \describe{
43 43
#'
44 -
#' \item{`data` as `character` `vector`}{containing field (column) name(s) that
44 +
#' \item{`data` as `character` vector}{containing field (column) name(s) that
45 45
#'   contain penalty values for planning units. This format is only
46 46
#'   compatible if the planning units in the argument to `x` are a
47 47
#'   [`Spatial-class`], [sf::sf()], or
@@ -52,7 +52,7 @@
Loading
52 52
#'   contain multiple zones, the argument to `data` must
53 53
#'   contain a field name for each zone.}
54 54
#'
55 -
#' \item{`data` as a `numeric` `vector`}{containing values for
55 +
#' \item{`data` as a `numeric` vector}{containing values for
56 56
#'   planning units. These values must not contain any missing
57 57
#'   (`NA`) values. Note that this format is only available
58 58
#'   for planning units that contain a single zone.}

@@ -37,7 +37,7 @@
Loading
37 37
#'
38 38
#' \describe{
39 39
#'
40 -
#' \item{`weights` as a `numeric` `vector`}{containing weights for each feature.
40 +
#' \item{`weights` as a `numeric` vector}{containing weights for each feature.
41 41
#'   Note that this format cannot be used to specify weights for problems with
42 42
#'   multiple zones.}
43 43
#'

@@ -48,7 +48,7 @@
Loading
48 48
#'   Note that all layers for a given zone must have `NA` values in exactly the
49 49
#'   same cells.}
50 50
#' \item{planning unit data are a [`Spatial-class`] or `data.frame`
51 -
#'   object}{`character` `vector` containing column names can
51 +
#'   object}{`character` vector containing column names can
52 52
#'   be supplied to specify the expected amount of each feature under each
53 53
#'   zone. Note that these columns must not contain any `NA` values.}
54 54
#' \item{planning unit data are a [`Spatial-class`], `data.frame`, or

@@ -7,13 +7,7 @@
Loading
7 7
#' fulfill as many targets as possible while ensuring that the cost of the
8 8
#' solution does not exceed a budget.
9 9
#'
10 -
#' @param x [problem()] (i.e. [`ConservationProblem-class`]) object.
11 -
#'
12 -
#' @param budget `numeric` value specifying the maximum expenditure of
13 -
#'   the prioritization. For problems with multiple zones, the argument
14 -
#'   to `budget` can be a single `numeric` value to specify a budget
15 -
#'   for the entire solution or a `numeric` `vector` to specify
16 -
#'   a budget for each each management zone.
10 +
#' @inheritParams add_max_utility_objective
17 11
#'
18 12
#' @details
19 13
#' The maximum feature representation objective is an enhanced version of the

@@ -11,7 +11,7 @@
Loading
11 11
#' @param n `integer` number of threads.
12 12
#'
13 13
#' @details This function returns a `list` containing an element for
14 -
#'   each worker. Each element contains a `integer` `vector`
14 +
#'   each worker. Each element contains a `integer` vector
15 15
#'   specifying the indices that the worker should process.
16 16
#'
17 17
#' @return `list` object.

@@ -29,13 +29,13 @@
Loading
29 29
#' @details
30 30
#' This function adds general purpose constraints that can be used to
31 31
#' ensure that solutions meet certain criteria
32 -
#' (see Example section below for details).
32 +
#' (see Examples section below for details).
33 33
#' For example, these constraints can be used to add multiple budgets.
34 34
#' They can also be used to ensure that the total number of planning units
35 35
#' allocated to a certain administrative area (e.g. country) does not exceed
36 -
#' a certain threshold (e.g. 30\% of its total area). Furthermore,
36 +
#' a certain threshold (e.g. 30% of its total area). Furthermore,
37 37
#' they can also be used to ensure that features have a minimal level
38 -
#' of representation (e.g. 30\%) when using an objective
38 +
#' of representation (e.g. 30%) when using an objective
39 39
#' function that aims to enhance feature representation given a budget
40 40
#' (e.g. [add_min_shortfall_objective()]).
41 41
#'
@@ -51,11 +51,11 @@
Loading
51 51
#' planning units \eqn{i \in I}{i in I} for zones \eqn{z \in Z}{z in Z}
52 52
#' (argument to `data`, if supplied as a `matrix` object),
53 53
#' \eqn{\theta} denote the constraint sense
54 -
#' (argument to `sense`), and \eqn{t} denote the constraint threshold
55 -
#' (argument to `threshold`).
54 +
#' (argument to `sense`, e.g. \eqn{<=}), and \eqn{t} denote the constraint
55 +
#' threshold (argument to `threshold`).
56 56
#'
57 57
#' \deqn{
58 -
#' \sum_{i}^{I} \sum_{z}^{Z} (D_{iz} \times X_{iz}) \theta t
58 +
#' \sum_{i}^{I} \sum_{z}^{Z} (D_{iz} \times X_{iz}) \space \theta \space t
59 59
#' }{
60 60
#' sum_i^I sum (Diz * Xiz) \theta t
61 61
#' }

@@ -12,13 +12,7 @@
Loading
12 12
#' This function was inspired by Faith (1992) and Rodrigues *et al.*
13 13
#' (2002).
14 14
#'
15 -
#' @param x [problem()] (i.e. [`ConservationProblem-class`]) object.
16 -
#'
17 -
#' @param budget `numeric` value specifying the maximum expenditure of
18 -
#'   the prioritization. For problems with multiple zones, the argument
19 -
#'   to `budget` can be a single `numeric` value to specify a budget
20 -
#'   for the entire solution or a `numeric` `vector` to specify
21 -
#'   a budget for each each management zone.
15 +
#' @inheritParams add_max_utility_objective
22 16
#'
23 17
#' @param tree [phylo()] object specifying a phylogenetic tree
24 18
#'   for the conservation features.

@@ -16,9 +16,9 @@
Loading
16 16
#'
17 17
#' @param budget `numeric` value specifying the maximum expenditure of
18 18
#'   the prioritization. For problems with multiple zones, the argument
19 -
#'   to `budget` can be a single `numeric` value to specify a budget
20 -
#'   for the entire solution or a `numeric` `vector` to specify
21 -
#'   a budget for each each management zone.
19 +
#'   to `budget` can be (i) a single `numeric` value to specify a single budget
20 +
#'   for the entire solution or (ii) a `numeric` vector to specify
21 +
#'   a separate budget for each management zone.
22 22
#'
23 23
#' @details
24 24
#' The maximum utility objective seeks to maximize the overall level of

@@ -12,16 +12,7 @@
Loading
12 12
#' history as possible. This function was inspired by Faith (1992),
13 13
#' Rodrigues *et al.* (2002), and Rosauer *et al.* (2009).
14 14
#'
15 -
#' @param x [problem()] (i.e. [`ConservationProblem-class`]) object.
16 -
#'
17 -
#' @param budget `numeric` value specifying the maximum expenditure of
18 -
#'   the prioritization. For problems with multiple zones, the argument
19 -
#'   to `budget` can be a single `numeric` value to specify a budget
20 -
#'   for the entire solution or a `numeric` `vector` to specify
21 -
#'   a budget for each each management zone.
22 -
#'
23 -
#' @param tree [phylo()] object specifying a phylogenetic tree
24 -
#'   for the conservation features.
15 +
#' @inheritParams add_max_phylo_div_objective
25 16
#'
26 17
#' @details
27 18
#' The maximum phylogenetic endemism objective finds the set of

@@ -44,7 +44,7 @@
Loading
44 44
#' The object returned from this function depends on the argument to
45 45
#' `a`. If the argument to `a` is an
46 46
#' [`OptimizationProblem-class`] object, then the
47 -
#' solution is returned as a `logical` `vector` showing the status
47 +
#' solution is returned as a `logical` vector showing the status
48 48
#' of each planning unit in each zone. However, in most cases, the argument
49 49
#' to `a` will be a [`ConservationProblem-class`] object, and so
50 50
#' the type of object returned depends on the number of solutions

@@ -43,7 +43,7 @@
Loading
43 43
#'
44 44
#' \describe{
45 45
#'
46 -
#' \item{`targets` as a `numeric` `vector`}{containing target values for each
46 +
#' \item{`targets` as a `numeric` vector}{containing target values for each
47 47
#'   feature.
48 48
#'   Additionally, for convenience, this format can be a single
49 49
#'   value to assign the same target to each feature. Note that this format
@@ -56,7 +56,7 @@
Loading
56 56
#'   `x`, and each cell contains the target value for a given feature
57 57
#'   that the solution needs to secure in a given zone.}
58 58
#'
59 -
#' \item{`targets` as a `character` `vector`}{containing the names of fields
59 +
#' \item{`targets` as a `character` vector}{containing the names of fields
60 60
#'   (columns) in the feature data associated with the argument to `x` that
61 61
#'   contain targets. This format can only be used when the
62 62
#'   feature data associated with `x` is a `data.frame`.

@@ -147,15 +147,15 @@
Loading
147 147
#'
148 148
#' @param name `character` name of parameter.
149 149
#'
150 -
#' @param value `vector` of values.
150 +
#' @param value `numeric` vector of values.
151 151
#'
152 -
#' @param label `character` `vector` of labels for each value.
152 +
#' @param label `character` vector of labels for each value.
153 153
#'
154 -
#' @param lower_limit `vector` of values denoting the minimum acceptable
154 +
#' @param lower_limit `numeric` vector of values denoting the minimum acceptable
155 155
#'   value for each element in `value`. Defaults to the
156 156
#'   smallest possible number on the system.
157 157
#'
158 -
#' @param upper_limit `vector` of values denoting the maximum acceptable
158 +
#' @param upper_limit `numeric` vector of values denoting the maximum acceptable
159 159
#'   value for each element in `value`. Defaults to the
160 160
#'   largest  possible number on the system.
161 161
#'
Files Coverage
R 94.92%
src 98.81%
Project Totals (124 files) 96.11%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading