Skip to content

Releases: prioritizr/prioritizr

prioritizr 8.0.3

17 Aug 02:14
Compare
Choose a tag to compare

Notice

  • We have developed a better approach for rescaling boundary data to
    avoid numerical issues during optimization (#297). Earlier versions of the
    package recommended the use of the scales::rescale() to rescale such data.
    However, we now realize that this approach can produce inconsistencies for
    boundary length data (e.g., the total perimeter of a planning unit might not
    necessarily equal the sum of the edge lengths). In some cases, these
    inconsistencies can cause solutions generated with high boundary
    penalties (i.e., using add_boundary_penalties() with a high penalty
    value) to contain a large reserve (i.e., a spatial cluster of selected of
    planning units) with a single unselected planning unit in the middle of the
    reserve. In the the worst case, these inconsistencies produce a situation
    where increasing boundary penalties (i.e., generating multiple solutions with
    add_boundary_penalties() and increasing penalty values)
    does not alter the spatial configuration of solutions. Although use of
    scales::rescale() did not produce such behavior prior to version 8.0.0,
    changes to the output format for boundary_matrix() in subsequent versions
    now mean that scales::rescale() can cause these issues. We now recommend
    using the new rescale_matrix() function to rescale boundary length data to
    avoid numerical issues, whilst also avoid such inconsistencies.

New features

  • New rescale_matrix() function to help with rescaling boundary length
    (e.g., generated using boundary_matrix()) and connectivity
    (e.g., generated using connectivity_matrix()) data so avoid
    numerical issues during optimization (#297).
  • Update add_neighbors_constraints() so that it has an additional
    clamp argument so the minimum number of neighbors permitted for
    each planning unit in the solution is clamped to the number of neighbors that
    each planning unit has. For example, if a planning unit has 2 neighbors,
    k = 3, and clamp = FALSE, then the planning unit could not
    ever be selected in the solution. However, if clamp = TRUE, then
    the planning unit could potentially be selected in the solution if both of
    its 2 neighbors were also selected.

Minor improvements and bug fixes

  • Update examples and vignettes to use the rescale_matrix() function
    instead of the scales::rescale() function for rescaling boundary
    length and connectivity data (#297).
  • Update the print() and summary() methods for problem() objects
    so that they will now better describe situations when the planning cost
    data all contain a constant value (e.g., all costs equal to 1).
  • Fix issue with problem() that prevents features being supplied as
    a data.frame that contains feature names stored as a factor (#295).
  • Fix broken URLs in documentation.
  • Fix compatibility with updates to terra package.
  • Fix rij_matrix() so that it works when none of the raster layers being
    processed fit into memory (#290).
  • Fix spatial extent of built-in raster datasets so that extents are between
    0 and 1 (i.e., get_sim_pu_raster(), get_sim_locked_in_raster(),
    get_sim_locked_out_raster(), get_sim_zones_pu_raster(),
    get_sim_features(), get_sim_zones_features()).
  • Update add_manual_locked_constraints() and
    add_manual_bounded_constraints() so that the indices in the
    specified in the argument data$pu should consistently refer to the total
    units. In other words, the indices in data$pu should refer to the row
    numbers (for planning units in sf or data.frame format) or cell numbers
    (for planning units in Raster or SpatRaster format) of the planning units
    that should be locked.
  • Fix warnings thrown due to package version comparisons.
  • Update problem() so that it will throw a meaningful error message if the
    user accidentally specifies the geometry column for sf planning unit data
    as a feature.
  • Export solve.ConservationProblem() so that it can be called directly (#283).
  • Fix compatibility with highs package (version 0.1-10) (#281).
  • Update problem() so that an error will be thrown if argument to features
    contains only missing (NA) values (e.g., an sf object is supplied that
    has NA values in all rows for a feature's column).
  • Update publication record.

prioritizr 8.0.2

09 May 13:49
0b967b1
Compare
Choose a tag to compare

Notice

  • The package has been updated to focus on using the sf and terra package
    for spatial vector and raster datasets. This is because the sf package is
    the successor to the sp package, and the terra package is the successor
    to the raster package. By leveraging these newer packages, the prioritizr
    package can provide better performance. Although sp and raster package
    classes (e.g., raster::stack() and sp::SpatialPolyonsDataFrame())
    are still supported, the prioritizr package will now throw deprecation
    warnings. Since support for the sp and raster package classes
    will be fully deprecated and removed in a later version this year, we
    recommend updating code to use the sf and terra packages.

Breaking changes

  • All proto classes have been migrated to R6 classes. This update reduces
    memory usage (#238), so problem() objects can now contain many more
    constraints and penalties. Note that any problem() objects
    that were produced using earlier versions of the package are no longer
    compatible.
  • The proto, raster, sf, sp packages are no longer automatically
    loaded alongside prioritizr. As such, users will need to load them manually
    (e.g., using library(sf)).
  • The built-in datasets have been removed and replaced with functions
    to import them as needed (i.e., get_sim_pu_raster(),
    get_sim_pu_polygons(), get_sim_pu_lines(), get_sim_pu_points(),,
    get_sim_locked_in_raster(), get_sim_locked_out_raster(),
    get_sim_zones_pu_raster(), get_sim_zones_pu_polygons(),
    get_sim_phylogeny(), get_sim_features(), get_sim_zones_features()).
    These functions now return sf::st_sf(),
    terra::rast(), ape::read.tree() and zones() objects.
    Note that these functions are provided because data(...) cannot be
    used with terra::rast() objects. See ?data for more information.
  • The boundary_matrix() output format has been updated. This means that
    users will not be able to use boundary data generated using previous
    versions of the package.
  • The add_lpsymphony_solver() now throws an error, instead of a warning,
    if an old version of the lpsymphony R package is installed that is known
    to produce incorrect results.
  • The marxan_boundary_data_to_matrix() function is no longer compatible
    with boundary data for multiple zones.
  • The distribute_load() function has been deprecated, because it is no
    longer used. For equivalent functionality, See parallel::splitIndices().
  • The new_optimization_problem() and predefined_optimization_problem()
    functions have been superseded by the new optimization_problem() function.
  • To simplify package documentation and functionality, the following functions
    are no longer exported: is.Waiver(), add_default_decisions()
    new_id(), is.Id(), print.Id(), pproto().

New features

  • The print() function for problem(), optimization_problem(), and
    zones() objects has been updated to provide more information.
  • New summary() function to provide extensive detail on problem() objects.
  • Updates to improve the error messages and error message handling.
    Hopefully, users should no longer see "bad error message"!

Minor improvements and bug fixes

  • Fix bug for add_feature_weights() when applied to problems with
    an add_max_phylo_div_objective() or add_max_phylo_end_objectve().
    Specifically, the bug meant that weights weren't being applied to
    problems with these particular objectives.
  • Fix instructions in add_gurobi_solver() documentation for opening vignette.
  • Update solver functions to provide instructions for installing
    dependencies in error messages when their dependencies are not available.
  • To ensure consistency among the portfolio functions, all of them (except for
    add_extra_portfolio()) default to generating 10 solutions.
  • Update publication record.
  • The solve() function will now output tibble::tibble() objects
    (instead of data.frame() objects), when the planning unit data are
    tibble::tibble() objects.
  • The boundary_matrix() function now uses terra::sharedPaths() for
    calculations, providing greater performance (#257).
  • The eval_ferrier_importance() function can now be used with
    any objective function that uses targets and a single zone.
  • Fix CRAN note regarding C++ standards (#263).
  • Remove doParallel and plyr packages as dependencies by simplifying
    the add_shuffle_portfolio() and eval_replacement_importance() functions.
  • Assorted tweaks to improve writing in the vignettes and documentation.
    Many thanks to Marc Edwards (@edwardsmarc)!

prioritizr 7.2.2

18 Sep 15:31
648a265
Compare
Choose a tag to compare
  • Fix compiler warnings.
  • Update tests to skip long-running tests on CRAN.
  • Update examples to minimize overall package check timings for CRAN.
  • Fix compatibility with upcoming Matrix package version (version 1.5-0).
  • Update package documentation to provide details for obtaining and installing the cplexAPI package since it has been archived on CRAN (#214).
  • Fix bug that caused the add_cbc_solver() to throw a segfault when solving a problem wherein the rij_matrix(x) has a zero amount for the last feature in the last planning unit (#247).
  • Update simulate_data(), simulate_cost() and simulate_species() functions to improve performance using the fields package.
  • Update boundary_matrix() to use STR query trees by default.
  • Remove maptools, PBSmapping, and rgeos packages as dependencies. This involved updating the unit tests to hard-code correct results, updating examples to use the sf package, and updating the boundary_matrix() to use the geos package (#218).
  • Fix broken URLs in package documentation.
  • Update publication record.
  • Update the presolve_check() function to (i) reduce chances of it incorrectly throwing an error when the input data won't actually cause any issues, and (ii) provide recommendations for addressing issues.
  • Update documentation for add_min_largest_shortfall_objective() so that examples complete in a shorter period of time.
  • Fix bug in processing planning unit data when a problem is constructed using arguments to (i) x that are numeric or matrix format, (ii) x that contain missing (NA) values, and (iii) rij_matrix that are in dgCMatrix format. This bug only occurred when all three of these specific conditions were met. When it occurred, the bug caused planning units with NA cost values to receive very high cost values (e.g., 1e+300). This bug meant that when attempting to solve the problem, the presolve checks (per presolve_check()) would throw an error complaining about very high cost values (#236).
  • Fix add_locked_in_constraints() and add_locked_out_constraints() to ensure that a meaningful error message is provided when no planing units are locked (#234).
  • Fix presolve_check() so that it does not throw a meaningless warning when the mathematical objective function only contains zeros.
  • Update presolve_check() to help reduce chances of mis-attributing high connectivity/boundary values due to planning unit costs.
  • Update add_connectivity_penalties() function and documentation so that it is designed specifically for symmetric connectivity data.
  • New add_asym_connectivity_penalties() function that is designed specifically for asymmetric connectivity data. This function has been created to help ensure that asymmetric connectivity data are handled correctly. For instance, using asymmetric connectivity data with add_connectivity_penalties() function in previous versions of the package sometimes resulted in the data being incorrectly treated as symmetric data. Additionally, this function uses an updated mathematical formulation for handling asymmetric connectivity so that it provides similar results to the Marxan software (#323).
  • Update marxan_problem() function so that it can be used with asymmetric connectivity data. This is now possible because there are dedicated functions for symmetric and asymmetric connectivity.
  • Improve documentation for the zones parameter of the add_connectivity_penalties() function.
  • Update documentation for eval_ferrier_importance() (#220). Although this function is now recommended for general use, the documentation contained an outdated warning and so the warning has now been removed.
  • Fix bug so that the eval_n_summary() function now returns a table with the column name "n" (instead of "cost") for the number of selected planning units (#219).
  • Update reference index for package website.
  • Fix minor typos in vignettes.
  • Minimum version numbers are now provided for all R package dependencies (excepting base R packages) (#217).
  • The data.table package is now listed as a suggested (optional) dependency. This is because it is only used by the marxan_problem() for importing Marxan data files.
  • The Tasmania tutorial has been reworked into the Getting started tutorial. This tutorial now provides short introduction to using the package.
  • The Salt Spring Island tutorial has been reworked into the Connectivity tutorial. This tutorial now explores different approaches for incorporating connectivity.
  • The prioritizr vignette has been renamed to the Package overview vignette.
  • New Calibrating trade-offs tutorial showcasing methods for running calibration analyses. It outlines blended and hierarchical approaches for generating a set of different prioritizations based on different parameters. It also covers different approaches for selecting a candidate prioritization based on different trade-offs.
  • Update tests to reduce run time and pass given slightly different results with new Gurobi version (9.5.0).
  • Update built-in sim_pu_sf and sim_pu_zones_sf data given class updates to the sf package (compatible with version 1.0.3+).
  • Update example for write_problem() function.

prioritizr 7.1.1

30 Oct 01:03
0919786
Compare
Choose a tag to compare
fix vign issues (#213)

* fix vign issues
* add lpsymphony to remotes
* setup bioc remote for lpsymphony

prioritizr 7.0.1

18 Oct 00:35
Compare
Choose a tag to compare
v7.0.1

fix url for cran

prioritizr 3.0.4

23 Apr 05:43
Compare
Choose a tag to compare

This release contains version 3.0.4 of the prioritizr R package. It is significant because this version is the most the most up-to-date and best-working version of the package before it was over-hauled to manage problems with multiple management zones.