one_hot: One hot encoder for natural numbers without the 0.

View source: R/utils.R

one_hotR Documentation

One hot encoder for natural numbers without the 0.

Description

Given a natural number, return the natural number equivalent to its one-hot encoding. Examples: 3 -> 100 -> 4, 5 -> 10000 -> 16

Usage

one_hot(nat)

Arguments

nat

the natural number to convert

Value

the converted number


dbnR documentation built on Jan. 13, 2026, 5:06 p.m.