%select% | R Documentation |
This operator extracts particular parameter quantities from a param_block
array.
x %select% select
x %s% select
x |
An object of class " |
select |
A list with two elements (2nd element is optional):
|
This function can be used instead of the other param_block
operators to emulate
a more "traditional" means of subsetting arrays comparable to data.frame
objects. Since it
relies on partial matching, rather than regular expressions, any name will extract either 0 or 1
parameters, samples, quantiles, or diagnostics, depending on whether the name had a clear match
or not. Furthermore, any number i
will extract that i
th parameter, sample,
quantile, or diagnostic, rather than using "special" rules (branchwise rate searching, etc.).
Note that out of bound numbers are ignored, rather than returning NA
's. Other
param_block
conventions are still enforced: collapsed dimensions have their information
stored as attributes and specific chains cannot be selected. You still have to use
select.chains on entire evorates_fit
objects for selecting particular chains.
An array of class "param_block
" with the same param_type
as x
.
The dimension of these arrays will generally go in the order of samples/quantiles/diagnostics,
then parameters, then chains. Any dimensions of length 1 are collapsed and stored as attributes.
This function relies on pmatch for partial matching.
Other param_block operators:
%chains%()
,
%diagnostics%()
,
%means%()
,
%quantiles%()
#get whale/dolphin evorates fit
data("cet_fit")
#get a chains param_block array
par <- cet_fit %chains% "R"
#note partial match vs. regular expressions behavior
par %select% "R_1"
par %select% list(NULL)
#note numeric index selection behavior change too
par %select% 1
#get a quantiles param_block array
par <- cet_fit %quantiles% "R"
#note numeric index selection behavior change for quantiles
par %select% list(1, 1)
#get a means param_block array
par <- cet_fit %means% "R"
#note 2nd element of list is ignored
par %select% list(1, 2)
#get a diangostics param_block array
par <- cet_fit %diagnostics% "R"
#note partial vs. regular expressions behavior for selecting diagnostics
par %select% list(1, "bulk")
par %select% list(1, "ess") #returns empty array with warning
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.