Skip to content

Commit

Permalink
Rd check links
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcaceres committed Jul 23, 2024
1 parent 85e00e7 commit 61d66fb
Show file tree
Hide file tree
Showing 43 changed files with 229 additions and 228 deletions.
8 changes: 4 additions & 4 deletions R/add_forests.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
#' \item{"Z50": Depth (in mm) corresponding to 50 percent of fine roots.}
#' \item{"Z95": Depth (in mm) corresponding to 95 percent of fine roots.}
#' }
#' @param SpParams A data frame with species parameters (see \code{\link{SpParamsMED}}) from which valid species names are drawn.
#' @param merge_trees A logical flag to simplify tree cohorts by merging tree records in DBH classes (see \code{\link{forest_mergeTrees}}).
#' @param merge_shrubs A logical flag to simplify shrub cohorts by merging shrub records in height classes (see \code{\link{forest_mergeShrubs}}).
#' @param SpParams A data frame with species parameters (see \code{\link[medfate]{SpParamsMED}}) from which valid species names are drawn.
#' @param merge_trees A logical flag to simplify tree cohorts by merging tree records in DBH classes (see \code{\link[medfate]{forest_mergeTrees}}).
#' @param merge_shrubs A logical flag to simplify shrub cohorts by merging shrub records in height classes (see \code{\link[medfate]{forest_mergeShrubs}}).
#' @param progress A logical flag to include a progress bar while processing the data.
#'
#' @details The current implementation will replace existing forests of the indicated 'id' values.
#'
#' @return A modified object of class \code{\link{sf}} with column 'forest'.
#' @return A modified object of class \code{\link[sf]{sf}} with column 'forest'.
#' @seealso [impute_forests()], \code{\link[medfate]{forest_mapWoodyTables}}, \code{\link[medfate]{forest_mergeTrees}}
#'
#' @author Miquel De \enc{Cáceres}{Caceres} Ainsa, CREAF
Expand Down
8 changes: 4 additions & 4 deletions R/add_soilgrids.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' Function \code{modify_soils} modifies soil definition according to soil depth and depth to bedrock information.
#' Function \code{check_soils} verifies that soil data does not contain missing values for key variables and, if so, assigns default values.
#'
#' @param x An object of class \code{\link{sf}} with a valid CRS definition. If it contains a column called 'land_cover_type', soils will be retrieved for "agriculture" and "wildland"
#' @param x An object of class \code{\link[sf]{sf}} with a valid CRS definition. If it contains a column called 'land_cover_type', soils will be retrieved for "agriculture" and "wildland"
#' cover types only. Otherwise, soils are retrieved for all locations. For functions \code{modify_soils} or \code{check_soils}, \code{x} should already contain a column named "soil".
#' @param soilgrids_path Path to SoilGrids rasters (see details). If missing, the SoilGrids REST API (https://rest.isric.org) will be queried.
#' @param widths A numeric vector indicating the desired layer widths, in \emph{mm}. If \code{NULL} the default soil grids layer definition is returned.
Expand All @@ -31,7 +31,7 @@
#' When \code{depth_to_bedrock_map} is provided, the function truncates the total depth of the soil definition to the depth to bedrock.
#' If regional maps of soil depth are not available, users are recommended to resort on Shangguan et al (2017).
#'
#' @return A modified object of class \code{\link{sf}} with column 'soil'.
#' @return A modified object of class \code{\link[sf]{sf}} with column 'soil'.
#'
#' @author \enc{Víctor}{Victor} Granda, EMF-CREAF
#' @author Miquel De \enc{Cáceres}{Caceres} Ainsa, EMF-CREAF
Expand Down Expand Up @@ -217,8 +217,8 @@ add_soilgrids <- function(x, soilgrids_path = NULL,
return(soildf)
}

#' @param soil_depth_map An object of class \code{\link{rast}} or \code{\link{vect}} with the soil depth (in \emph{mm}) values.
#' @param depth_to_bedrock_map An object of class \code{\link{rast}} or \code{\link{vect}} with depth to bedrock (in \emph{mm}) values.
#' @param soil_depth_map An object of class \code{\link[terra]{SpatRaster}} or \code{\link[terra]{SpatVector}} with the soil depth (in \emph{mm}) values.
#' @param depth_to_bedrock_map An object of class \code{\link[terra]{SpatRaster}} or \code{\link[terra]{SpatVector}} with depth to bedrock (in \emph{mm}) values.
#' @param regolith_rfc Rock fragment content, in percent volume, between soil depth and 200cm depth (or lower depths, if modified via \code{widths}).
#' @param full_rock_filling Logical flag to modify rock fragment content in all soil layers with according to distance to soil depth.
#'
Expand Down
10 changes: 5 additions & 5 deletions R/add_topography.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
#'
#' Initializes topography and land cover type for a set of target locations
#'
#' @param x An object of class \code{\link{sf}}
#' @param dem A digital elevation model (class \code{\link{SpatRaster}}) with meters as units
#' @param land_cover_map An object of class \code{\link{SpatRaster}} of land cover type. If missing, all locations are considered 'wildland'.
#' @param x An object of class \code{\link[sf]{sf}}
#' @param dem A digital elevation model (class \code{\link[terra]{SpatRaster}}) with meters as units
#' @param land_cover_map An object of class \code{\link[terra]{SpatRaster}} of land cover type. If missing, all locations are considered 'wildland'.
#' @param wildland,agriculture,rock,artificial,water Strings indicating the mapping from the legend of land_cover_map.
#' @param progress A logical flag to print console output
#'
#' @details
#' The user should manually define the mapping of land cover classes in \code{land_cover_map} to the land cover types
#' used in medfateland.
#'
#' @return Function \code{add_topography()} returns a modified object of class \code{\link{sf}} with columns:
#' @return Function \code{add_topography()} returns a modified object of class \code{\link[sf]{sf}} with columns:
#' \itemize{
#' \item{\code{id}: Numeric location identifiers (if not existing).}
#' \item{\code{elevation}: Elevation above sea level (in m).}
#' \item{\code{slope}: Slope (in degrees).}
#' \item{\code{aspect}: Aspect (in degrees).}
#' \item{\code{land_cover_type}: Land cover type.}
#' }
#' Function \code{add_land_cover()} returns a modified object of class \code{\link{sf}} with new column:
#' Function \code{add_land_cover()} returns a modified object of class \code{\link[sf]{sf}} with new column:
#' \itemize{
#' \item{\code{id}: Numeric location identifiers (if not existing).}
#' \item{\code{land_cover_type}: Land cover type.}
Expand Down
4 changes: 2 additions & 2 deletions R/create_management_scenario.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' years according to the growth observed and the desired extraction rates.
#' @param default_management_arguments A list of arguments to be passed to the managementFunction. These arguments will be taken as defaults
#' copied for all management units and can later be modified. If NULL, the result of calling function
#' \code{\link{defaultManagementArguments}} will be taken.
#' \code{\link[medfate]{defaultManagementArguments}} will be taken.
#'
#' @details
#' Three kinds of management scenarios are allowed:
Expand Down Expand Up @@ -48,7 +48,7 @@
#'
#' Aitor \enc{Améztegui}{Ameztegui}, UdL
#'
#' @seealso \code{\link{fordyn_scenario}}, \code{\link{defaultManagementFunction}}, \code{\link{defaultPrescriptionsBySpecies}}, \code{\link{create_fire_regime}}
#' @seealso \code{\link{fordyn_scenario}}, \code{\link[medfate]{defaultManagementFunction}}, \code{\link{defaultPrescriptionsBySpecies}}, \code{\link{create_fire_regime}}
#'
#' @examples
#'
Expand Down
8 changes: 4 additions & 4 deletions R/dataset_documentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
#' Mario Beltrán & Míriam Piqué. Forest Science and Technology Centre of Catalonia (CTFC)
#' @keywords data
#'
#' @seealso \code{\link{create_management_scenario}}, \code{\link{defaultManagementArguments}},
#' @seealso \code{\link{create_management_scenario}}, \code{\link[medfate]{defaultManagementArguments}},
#' \code{\link{fordyn_scenario}}
NULL


#' Example of watershed
#'
#' An example of an object of \code{\link{sf}} with data for a small catchment of 66 ha (0.66 km2) in Catalonia.
#' An example of an object of \code{\link[sf]{sf}} with data for a small catchment of 66 ha (0.66 km2) in Catalonia.
#' Object \code{example_watershed_burnin} is the result of three years of burn-in period.
#'
#' @name example_watershed
#' @aliases example_watershed example_watershed_burnin
#' @docType data
#' @format
#' The data format is that of an object \code{\link{sf}}
#' The data format is that of an object \code{\link[sf]{sf}}
#'
#' @source
#' \itemize{
Expand Down Expand Up @@ -55,7 +55,7 @@ NULL
#'
#' @name example_ifn
#' @docType data
#' @format The data format is that of an object \code{\link{sf}}
#' @format The data format is that of an object \code{\link[sf]{sf}}
#'
#' @source
#' \itemize{
Expand Down
2 changes: 1 addition & 1 deletion R/default_volume_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Example function for estimating wood volume (in m3/ha) from a tree table or forest object.
#'
#' @param x A data frame with columns 'DBH', 'Height' and 'N' or a \code{\link{forest}} object
#' @param x A data frame with columns 'DBH', 'Height' and 'N' or a \code{\link[medfate]{forest}} object
#' @param SpParams A data frame with species parameters (not used in the default function but will be called)
#'
#' @details Users should define their own functions taking into account that:
Expand Down
9 changes: 5 additions & 4 deletions R/dispersal.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@ kernel_int <- function(r, alpha, c) {
# }
# plot(dist_vec, kernel_fun(dist_vec, alpha,c), type = "l", log = log)
# }

#' Seed production, dispersal and seed bank dynamics
#'
#' Simulates seed bank mortality, seed production and dispersal among stands
#'
#' @param sf An object of class \code{\link{sf}} using a UTM projection (to measure distances in m) and with the following columns:
#' @param sf An object of class \code{\link[sf]{sf}} using a UTM projection (to measure distances in m) and with the following columns:
#' \itemize{
#' \item{\code{geometry}: Spatial geometry.}
#' \item{\code{forest}: Objects of class \code{\link{forest}}.}
#' \item{\code{forest}: Objects of class \code{\link[medfate]{forest}}.}
#' }
#' @param SpParams A data frame with species parameters (see \code{\link{SpParamsMED}}).
#' @param local_control A list of control parameters (see \code{\link{defaultControl}})
#' @param SpParams A data frame with species parameters (see \code{\link[medfate]{SpParamsMED}}).
#' @param local_control A list of control parameters (see \code{\link[medfate]{defaultControl}})
#' @param distance_step Distance step in meters.
#' @param maximum_dispersal_distance Maximum dispersal distance in meters.
#' @param min_percent A minimum percent of seed bank to retain entry in \code{seedBank} element of \code{forest}.
Expand Down
10 changes: 5 additions & 5 deletions R/extract_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@
#'
#' Extract or estimate variables from landscape objects (class 'sf').
#'
#' @param x An object of class \code{\link{sf}} with the appropriate columns.
#' @param x An object of class \code{\link[sf]{sf}} with the appropriate columns.
#' @param vars A string vector with the name of the variables to extract (see details).
#' @param variable A string with the name of the variables to draw (see details).
#' @param SpParams A data frame with species parameters (see \code{\link{SpParamsMED}}), required for most forest stand variables.
#' @param r An object of class \code{\link{rast}}, defining the raster topology.
#' @param SpParams A data frame with species parameters (see \code{\link[medfate]{SpParamsMED}}), required for most forest stand variables.
#' @param r An object of class \code{\link[terra]{SpatRaster}}, defining the raster topology.
#' @param ... Additional arguments (not used).
#'
#' @details The following string values are available for \code{vars}.
Expand Down Expand Up @@ -369,12 +369,12 @@
#' \item{\code{"shrub_volume"}: Shrub volume (m3/m2).}
#' }
#'
#' @returns Function \code{extract_variables()} returns an object of class \code{\link{sf}} with the desired variables.
#' @returns Function \code{extract_variables()} returns an object of class \code{\link[sf]{sf}} with the desired variables.
#' Function \code{plot_variables()} returns a ggplot object.
#'
#' @author Miquel De \enc{Cáceres}{Caceres} Ainsa, CREAF.
#'
#' @seealso \code{\link{forest}}, \code{\link{soil}}, \code{\link{summary.forest}}, \code{\link{shinyplot_land}}
#' @seealso \code{\link[medfate]{forest}}, \code{\link[medfate]{soil}}, \code{\link[medfate]{summary.forest}}, \code{\link{shinyplot_land}}
#'
#' @examples
#' # Load data and species parameters from medfate
Expand Down
4 changes: 2 additions & 2 deletions R/fire_regime_instance.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Applies a fire regime object over a set of landscape units to determine a fire realization
#'
#' @param sf An object of class \code{\link{sf}} with the following columns:
#' @param sf An object of class \code{\link[sf]{sf}} with the following columns:
#' \itemize{
#' \item{\code{geometry}: Spatial geometry.}
#' \item{\code{id}: Stand identifiers.}
Expand All @@ -14,7 +14,7 @@
#' @details
#' The function randomly determines the landscape units that will burn every year, depending on the specifications
#' of the fire regime object. Users can define their own fire regime instances from other models (e.g. a fire landscape model)
#' and then use those directly in functions \code{\link{fordyn_spatial}} or \code{\link{fordyn_scenario}}-
#' and then use those directly in functions \code{\link{fordyn_spatial}} or \code{\link{fordyn_scenario}}.
#'
#' @return An integer matrix specifying the day of the year of burning of each landscape unit for every year in the fire regime definition.
#' Values are interpreted as follows:
Expand Down
18 changes: 9 additions & 9 deletions R/fordyn_scenario.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
#'
#' Evaluates forest dynamics over a landscape including climate and management scenarios
#'
#' @param sf An object of class \code{\link{sf}} with the following columns:
#' @param sf An object of class \code{\link[sf]{sf}} with the following columns:
#' \itemize{
#' \item{\code{geometry}: Spatial geometry.}
#' \item{\code{id}: Stand identifiers.}
#' \item{\code{elevation}: Elevation above sea level (in m).}
#' \item{\code{slope}: Slope (in degrees).}
#' \item{\code{aspect}: Aspect (in degrees).}
#' \item{\code{forest}: Objects of class \code{\link{forest}}.}
#' \item{\code{soil}: Objects of class \code{\link{soil}}.}
#' \item{\code{state}: Objects of class \code{\link{spwbInput}} or \code{\link{growthInput}} (optional).}
#' \item{\code{forest}: Objects of class \code{\link[medfate]{forest}}.}
#' \item{\code{soil}: Objects of class \code{\link[medfate]{soil}}.}
#' \item{\code{state}: Objects of class \code{\link[medfate]{spwbInput}} or \code{\link[medfate]{growthInput}} (optional).}
#' \item{\code{meteo}: Data frames with weather data (required if parameter \code{meteo = NULL}).}
#' \item{\code{management_unit}: Management unit corresponding to each stand.}
#' \item{\code{represented_area_ha}: Area represented by each stand in hectares.}
Expand All @@ -42,9 +42,9 @@
#' }
#' Alternatively, the user may supply the result of a previous call to \code{fordyn_scenario}, where
#' to continue simulations.
#' @param SpParams A data frame with species parameters (see \code{\link{SpParamsMED}}).
#' @param SpParams A data frame with species parameters (see \code{\link[medfate]{SpParamsMED}}).
#' @param meteo Meteorology data (see \code{\link{fordyn_spatial}}).
#' @param local_control A list of local model control parameters (see \code{\link{defaultControl}}).
#' @param local_control A list of local model control parameters (see \code{\link[medfate]{defaultControl}}).
#' @param volume_function A function accepting a forest object or a tree data table, and a species parameter table, as input and
#' returning the wood volume (m3/ha) corresponding to each tree cohort. The function may accept additional arguments.
#' If NULL, the default volume function is used (not recommended!).
Expand All @@ -56,7 +56,7 @@
#' @param fire_regime A list of parameters defining the fire regime (see \code{\link{create_fire_regime}}) or
#' a matrix representing a fire regime instance (see \code{\link{fire_regime_instance}}).
#' If NULL, wildfires are not simulated. Details are given in \code{\link{fordyn_spatial}}.
#' @param summary_function An appropriate function to calculate summaries from an object of class 'fordyn' (e.g., \code{\link{summary.fordyn}}).
#' @param summary_function An appropriate function to calculate summaries from an object of class 'fordyn' (e.g., \code{\link[medfate]{summary.fordyn}}).
#' @param summary_arguments List with additional arguments for the summary function.
#' @param parallelize Boolean flag to try parallelization (will use all clusters minus one).
#' @param num_cores Integer with the number of cores to be used for parallel computation.
Expand All @@ -76,8 +76,8 @@
#' the previous state of the forest stand for the next year steps. Finally, the function evaluates how much of the specified demand
#' has been fulfilled and stores the results, including demand offsets to be applied the year after.
#'
#' Management is implemented using the \code{\link{defaultManagementFunction}} in medfate,
#' meaning that management parameters need to follow the structure of \code{\link{defaultManagementArguments}}
#' Management is implemented using the \code{\link[medfate]{defaultManagementFunction}} in medfate,
#' meaning that management parameters need to follow the structure of \code{\link[medfate]{defaultManagementArguments}}
#'
#' Details about the inclusion of fire regimes in simulations are explained in \code{\link{fordyn_spatial}}.
#'
Expand Down
Loading

0 comments on commit 61d66fb

Please sign in to comment.