Removes the private attributes with which a Bayes-factor carrier (see format_BF_from_log()) retains its canonical logarithms, so that the values can be stored in a plain data frame or compared as ordinary numbers.

BF_carrier_drop(x)

Arguments

x

a numeric vector, typically a Bayes factor created by format_BF_from_log() or format_BF(). A numeric matrix or array is also accepted and keeps its dimensions.

Value

BF_carrier_drop() returns x without its carrier attributes.

Details

The names and the public attributes name, logBF, BF01, and bound_operator are kept. The class BayesTools_BF is kept only while a non-missing bound operator remains, as for the result of format_BF() on a plain vector. A numeric vector without carrier attributes is returned with the same rule applied to its class.

Examples

BF <- format_BF_from_log(c(a = 2, b = 800))
names(attributes(BF))
#>  [1] "names"            "name"             "logBF"            "BF01"            
#>  [5] "bound_operator"   "canonical_log_BF" "producer_values"  "carrier_logBF"   
#>  [9] "carrier_BF01"     "class"           
names(attributes(BF_carrier_drop(BF)))
#> [1] "names"          "name"           "logBF"          "BF01"          
#> [5] "bound_operator"