@@ -373,7 +373,11 @@ initialise <- function(
373373
374374 # output list ---------------------------------------------
375375 out <- list (
376- n1_map = as.matrix(n1_map , wide = TRUE ),
376+ n1_map = matrix (
377+ data = as.integer(values(n1_map )),
378+ nrow = nrow(n1_map ),
379+ ncol = ncol(n1_map ),
380+ byrow = TRUE ),
377381 id = wrap(id ),
378382 dist_bin = dist_bin ,
379383 dist_resolution = dist_resolution ,
@@ -454,7 +458,7 @@ K_n1_map_check <- function(K_map, n1_map, changing_env) {
454458
455459# ' Get Carrying Capacity For The First Time Step
456460# '
457- # ' [ K_get_init_values] returns all values from map of carrying capacity
461+ # ' ` K_get_init_values` returns all values from map of carrying capacity
458462# ' in the first time step.
459463# '
460464# ' @inheritParams K_n1_map_check
@@ -484,19 +488,19 @@ K_get_init_values <- function(K_map, changing_env) {
484488
485489# ' Check For Precalculating Target Cells
486490# '
487- # ' [ calc_dist] checks if target cells should be precalculated
488- # ' and if so calls [ dist_list] .
491+ # ' ` calc_dist` checks if target cells should be precalculated
492+ # ' and if so calls ` dist_list` .
489493# '
490494# ' @param id [`SpatRaster`][terra::SpatRaster-class]; contains all cells ids
491495# ' @param data_table matrix; contains information about all cells in current
492496# ' time points
493497# ' @param dist_resolution integer vector of length 1; dimension of one side of
494498# ' one cell of `id`; in case of an irregular grid or lon/lat raster it is calculated during [`initialisation`][`initialise`]
495- # ' calculated by [ `calculate_dist_params`]
499+ # ' calculated by `calculate_dist_params`
496500# ' @param dist_bin numeric vector of length 1 with value `>= 0`; in case of an irregular grid or lon/lat raster it is
497- # ' calculated by [ `calculate_dist_params`]
501+ # ' calculated by `calculate_dist_params`
498502# ' is equal to 0 if input maps are planar raster; if input maps are lon/lat it is calculated by
499- # ' rasters, `dist_bin` is calculated by [ `calculate_dist_params`]
503+ # ' rasters, `dist_bin` is calculated by `calculate_dist_params`
500504# ' @param id_within numeric vector; ids of cells inside the study area
501505# ' @inheritParams initialise
502506# '
@@ -538,7 +542,7 @@ calc_dist <- function(
538542# ' Precalculating Target Cells For Dispersal
539543# '
540544# ' `dist_list` prepares data for precalculation of target cells ids
541- # ' and then uses [ `target_ids`] for calculation
545+ # ' and then uses `target_ids` for calculation
542546# '
543547# ' @inheritParams calc_dist
544548# '
@@ -651,7 +655,7 @@ calculate_dist_params <- function(id, id_within, data_table, progress_bar, quiet
651655# ' from any cells of template `r`. It takes raster's dist_resolution into account.
652656# '
653657# ' @param template template [`SpatRaster`][terra::SpatRaster-class] object
654- # ' @param dist_resolution parameter calculated by [ `calculate_dist_params`] function
658+ # ' @param dist_resolution parameter calculated by `calculate_dist_params` function
655659# '
656660# ' @return numeric vector; numbers of target cells on every possible distance
657661# ' range
0 commit comments