Skip to contents

Identifies whether a Betwixt table uses wide, dual-wide, long, or dual-long representation. It returns "invalid" for tables that cannot be identified as a valid Betwixt representation.

Usage

betwixt_representation(x)

Arguments

x

A data frame representing a Betwixt table.

Value

One of "wide", "dual_wide", "long", "dual_long", or "invalid".

Examples

x <- data.frame(
  row_id = 1:2,
  subject = c("Q1", "Q2"),
  instance_of = c("human", "human"),
  occupation = c("composer", "pianist")
)

betwixt_representation(x)
#> [1] "wide"
# "wide"