one_hot_cpp: One-hot encoder for natural numbers without the 0

View source: R/RcppExports.R

one_hot_cppR 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. Instead of pow, the '<<' operator will be used. Examples: 3 -> 100 -> 4, 5 -> 10000 -> 16

Usage

one_hot_cpp(nat)

Arguments

nat

the natural number to convert

Value

the converted number


dbnR documentation built on Oct. 5, 2022, 1:07 a.m.