Skip to contents

Create wide table

Usage

# Default S3 method
create_table(
  data,
  name_column = "item_name",
  value_column = "item_value",
  keep_vars = c("subject_id", "event_name", "event_repeat", "event_date"),
  expected_columns = NULL,
  ...
)

Arguments

data

A data frame to convert, in long format.

name_column

Character string. Column that contains all the names for the wide table format.

value_column

Character string. Column that contains all the values of the table in wide format.

keep_vars

all common variables that identify a unique single data row.

expected_columns

A character vector with the names of the expected variables. Needed to make sure that all expected columns are always created, even if some variables are implicitly missing (which might occur if there are not yet any values available for a specific variable). Also, implicitly missing variables might give errors if part of the script relies on the variables' presence.

...

Other options. Currently unused.

Value

A data frame in wide format