truth.table: Generate truth.table

View source: R/helper.R

truth.tableR Documentation

Generate truth.table

Description

Create a truth table for the number of bit's supplied. The Standard is a binary truth.table so the exponent = 2. If (exponent > 9) you can choose (hex_style = TRUE) to exchange any bigger number than 9 with letters,see examples for more information.

Usage

truth.table(
  bit,
  exponent = 2,
  hex_style = FALSE,
  stringsAsFactors = TRUE,
  KEEP.OUT.ATTRS = TRUE,
  fileName = NA
)

Arguments

bit

integer number of bits

exponent

type of truth table

hex_style

If exponent > 9 the number will be changed to letters.

stringsAsFactors

logical specifying if character vectors are converted to factors.Check expand.grid() documentation for more information.

KEEP.OUT.ATTRS

a logical indicating the "out.attrs" attribute. Check out expand.grid() function for more detailed information.

fileName

If a file name is supplied the created data frame will automatically saved in the actual working directory with file extension ".csv".

Value

A data frame containing one row for each combination of the supplied factors(bits) .

Author(s)

Florian Wagner florian.wagner@wagnius.ch

Examples

truth.table(3)
truth.table(3, 16)|>head(20)
truth.table(3, 16, hex_style = TRUE)|>head(20)

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.