Skip to contents

Marks one or more columns as free-text (FT) variables: coerces each to character, converts to_na values to NA, and attaches the flat metadata schema. Each column is its own group, so alias, alias_name, description and label apply only when a single column is selected.

Usage

step_set_ft(
  x,
  .cols,
  alias = NULL,
  alias_name = NULL,
  description = NULL,
  label = NULL,
  template = "{question}",
  to_na = "",
  snapshot_data = FALSE,
  status = TRUE
)

Arguments

x

A srv_tbl.

.cols

Tidy-select expression picking the text columns.

alias

Alias (group key). Defaults to the column name. Single column only.

alias_name

Human-friendly display name. Single column only.

description

Overrides the template-parsed description. Single column only.

label

Sets attr(col, "label") directly. Single column only.

template

Glue-style template parsed from the label. Default "{question}".

to_na

A value converted to NA (default "").

snapshot_data

Logical. If TRUE, a snapshot with data is taken; if FALSE, without data; if NULL, no snapshot.

status

Logical. If TRUE, a status message is printed.

Examples

if (FALSE) { # \dontrun{
data("srv_example", package = "g6tr.survey")
x <- srv_example |> step_set_ft(c("s_industryr25oe", "d_zip"))
} # }