bf_decode | R Documentation |
This function takes an integer bitfield and the registry used to build it upstream to decode it into bit representation and thereby unpack the data stored in the bitfield.
bf_decode(x, registry, flags = NULL, sep = NULL, verbose = TRUE)
x |
|
registry |
|
flags |
|
sep |
|
verbose |
|
data.frame with the binary values of flags in the registry in columns.
# build registry
reg <- bf_map(protocol = "na", data = bf_tbl, x = commodity)
reg <- bf_map(protocol = "matches", data = bf_tbl, x = commodity, set = c("soybean", "maize"),
registry = reg)
reg
# encode the flags into a bitfield
field <- bf_encode(registry = reg)
field
# decode (somewhere downstream)
flags <- bf_decode(x = field, registry = reg, sep = "-")
flags
# more reader friendly
cbind(bf_tbl, bf_decode(x = field, registry = reg, verbose = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.