parseProbVec {CPTtools} | R Documentation |
This takes a bunch of strings of the form "[High:.3,Med:.5,Low:.2]"
and parses it into a vector c(High=.3,Med=.5,Low=.2)
.
parseProbVec(pVec) parseProbVecRow(splitrow)
pVec |
A string of the form |
splitrow |
A collection of strings |
StatShop outputs marginal distributions in the format
[state0:val0,state1:val1,...]
. This
function takes a vector of strings containing probability vectors and
parses them, returning a matrix of the values, with column names given
by the names of the states.
The function parseProbVecRow()
is
an internal function which parses a single row (after it has been
split on the commas).
A matrix containing the values. The rows correspond to the elements
of pVec
. The columns correspond to the state names.
Russell Almond
http://research.ets.org/~ralmond/StatShop/dataFormats.html
parseProbVec(c(Good = "[High:.8,Med:.15,Low:.05]", Bad = "[High:.15,Med:.35,Low:.5]", Ugly = "[High:.01,Med:.09,Low:.9]"))