vis_binary: Visualise binary values

View source: R/vis-binary.R

vis_binaryR Documentation

Visualise binary values

Description

Visualise binary values

Usage

vis_binary(
  data,
  col_zero = "salmon",
  col_one = "steelblue2",
  col_na = "grey90",
  order = NULL
)

Arguments

data

a data.frame

col_zero

colour for zeroes, default is "salmon"

col_one

colour for ones, default is "steelblue2"

col_na

colour for NA, default is "grey90"

order

optional character vector of the order of variables

Value

a ggplot plot of the binary values

Examples

vis_binary(dat_bin)

# changing order of variables
# create numeric names
df <-  setNames(dat_bin, c("1.1", "8.9", "10.4"))
df

# not ideal
vis_binary(df)
# good - specify the original order
vis_binary(df, order = names(df))

tierneyn/visdat documentation built on June 29, 2023, 9:40 p.m.