Skip to contents

Modifies the various forcing parameters of the rsim scenario object.

Usage

adjust.forcing(
  Rsim.scenario,
  parameter,
  group,
  sim.year = 1,
  sim.month = 0,
  bymonth = F,
  value
)

Arguments

Rsim.scenario

Scenario object that contains all of the rsim rates and forcing functions generated by rsim.scenario().

parameter

Parameters to be modified (ForcedEffort,ForcedCatch,ForcedFRate)

group

Name of the group whose parameter is being changed. Valid values are found in the `Group` field of the object created from running rpath()

sim.year

Year of the simulation that should be modified. Can be a range of years.

sim.month

Month of the year that should be modified. If set to 0, all months of the year are modified.

bymonth

Boolean value that denotes whether to use sim.year/sim.month combo or just sim.month as a sequential vector starting at 1.

value

New value for the parameter.

Value

Returns an Rsim.scenario object with the new parameter.

See also

Other Adjust functions: adjust.fishing(), adjust.scenario(), set.rsim.scene()

Examples

# Read in Rpath parameter file and generate balanced model
Rpath <- rpath(AB.params)
# Create a 50 yr Rsim scenario
Rsim.scenario <- rsim.scenario(Rpath, AB.params, years = 1:50)
# Adjust the ForcedPrey parameter for cod in year 1 for all months. Change the value to 10
Rsim.scenario.adjusted <- adjust.forcing(Rsim.scenario, parameter="ForcedPrey",group = "cod", sim.year = 1, sim.month=0,value=10)   
head(Rsim.scenario.adjusted$forcing$ForcedPrey)
#>     Outside whales seals cod whiting mackerel anchovy shrimp benthos
#> 1.1       1      1     1  10       1        1       1      1       1
#> 1.2       1      1     1  10       1        1       1      1       1
#> 1.3       1      1     1  10       1        1       1      1       1
#> 1.4       1      1     1  10       1        1       1      1       1
#> 1.5       1      1     1  10       1        1       1      1       1
#> 1.6       1      1     1  10       1        1       1      1       1
#>     zooplankton phytoplankton detritus sealers trawlers seiners bait boats
#> 1.1           1             1        1       1        1       1          1
#> 1.2           1             1        1       1        1       1          1
#> 1.3           1             1        1       1        1       1          1
#> 1.4           1             1        1       1        1       1          1
#> 1.5           1             1        1       1        1       1          1
#> 1.6           1             1        1       1        1       1          1
#>     shrimpers
#> 1.1         1
#> 1.2         1
#> 1.3         1
#> 1.4         1
#> 1.5         1
#> 1.6         1