Description Usage Arguments Value Examples

Decode an integer into a base-`b`

array with `n`

digits. Note that
the base `b`

must be provided, but the number of digits `n`

is
optional. If it is provided then the decoded state will have exactly that
many elements. If `n`

is not provided, the length of the decoded state
is as small as possible.

1 |

`encoding` |
Numeric of the encoded state. |

`b` |
Numeric giving the desired base. |

`n` |
Numeric giving the desired number of digits. |

Vector giving the decoded state.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# The provided encoded state is decoded using the big-endian
# encoding scheme.
decode(2, b = 2, n = 2) # [1, 0]
decode(6, b = 2, n = 3) # [1, 1, 0]
decode(6, b = 3, n = 2) # [2, 0]
# If n is not provided, the length of the decoded state
# is as small as possible
decode(1, b = 2) # [1]
decode(1, b = 3) # [1]
decode(3, b = 2) # [1, 1]
decode(3, b = 3) # [1, 0]
decode(3, b = 4) # [3]
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.