params <- newMultispeciesParams(NS_species_params)
#### Setting allometric death rate #######################
# Set coefficient for each species. Here we choose 0.1 for each species
z0pre <- rep(0.1, nrow(species_params(params)))
# Multiply by power of size with exponent, here chosen to be -1/4
# The outer() function makes it an array species x size
allo_mort <- outer(z0pre, w(params)^(-1/4))
# Change the external mortality rate in the params object
ext_mort(params) <- allo_mort
Run the code above in your browser using DataLab