sequence.extract | R Documentation |
The array accessor generics allow extracting and replacing scenarios within
am existing sequence. [
and [[
work identical to
## S4 method for signature 'ScenarioSequence,numeric,missing,missing'
x[i]
## S4 method for signature 'ScenarioSequence,numeric'
x[[i]]
## S4 replacement method for signature 'ScenarioSequence,numeric,missing,EffectScenario'
x[[i, j]] <- value
## S4 method for signature 'ScenarioSequence'
length(x)
x |
sequence |
i |
index of elements to extract or replace |
j |
not used |
value |
new scenario |
various
x[i
: Returns a list of scenarios from the sequence.
x[[i
: Returns a single scenario from the sequence.
`[[`(x = ScenarioSequence, i = numeric, j = missing) <- value
: Replaces a single scenario in the sequence.
length(ScenarioSequence)
: Returns the number of scenarios in the sequence.
# create a sequence
seq <- sequence(list(minnow_it, minnow_it), breaks=3)
seq[1] # first element, as a list of scenarios
seq[c(1)] # the same
seq[c(1, 2)] # both elements as a list of scenarios
seq[[1]] # first element as a scenario
# replacing single elements
seq[[1]] <- minnow_sd %>% set_times(1:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.