Description Usage Arguments Value Note Examples
View source: R/prey_survival_simulation.R
Creates a dataframe of "paths" for each fish to "travel". A number of cells equal to path_length is randomly selected for each fish and becomes that fish's travel path.
1 2 3 4 5 | frame_of_all_cells_traversed_per_fish(
number_of_fish,
enc_prob_vector,
path_length
)
|
number_of_fish |
number (pos integer) of prey fish desired; should be the same as that for the prey_fish_lengths() function |
enc_prob_vector |
vector of all encounter probabilities calculated for each cell; see calc_enc_probs() |
path_length |
number of cells traversed; determined by calculate_path_length() |
a dataframe of encounter probabilities for each fish
this function can be parallelized; e.g., by setting plan(multisession)
1 2 3 4 5 6 7 8 | pred_pos <- get_pred_positions()
raster <- create_stream_raster_frame(pred_pos)
enc_prob_frame <- calc_enc_probs(raster)
enc_prob_vector <- enc_prob_frame %>% dplyr::pull(enc_prob)
path_length = calculate_path_length()
frame_of_all_cells_traversed_per_fish(number_of_fish = 10,
enc_prob_vector = enc_prob_vector,
path_length = path_length)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.