as_binary: Function to convert integers to binary strings.

View source: R/as_binary.R

as_binaryR Documentation

Function to convert integers to binary strings.

Description

as_binary converts integers to their binary representation. as_binary does not work for integers which are larger than 32 bit.

Usage

as_binary(x, n = 32)

Arguments

x

Integer to convert into its binary from.

n

Number of digits/bits to return. Default is 32.

Author(s)

Stuart K. Grange

See Also

stackoverflow

Examples

## Not run: 

# Vector with length of one
as_binary(5L)

# Sampled vector 
as_binary(sample(1L:1000L, 1000))


## End(Not run)


skgrange/threadr documentation built on April 15, 2024, 9:35 p.m.