finputc: Apply Character Invalue by Name (like 'SAS' INPUTC)

View source: R/format_invalue.R

finputcR Documentation

Apply Character Invalue by Name (like 'SAS' INPUTC)

Description

Looks up an INVALUE format by name from the global format library and applies it to convert labels to character values.

Usage

finputc(x, invalue_name)

Arguments

x

Character vector of labels to convert

invalue_name

Character. Name of a registered INVALUE format.

Value

Character vector

Examples

# Bidirectional: use finputc for reverse direction
fnew_bid(
  "A" = "Active",
  "I" = "Inactive",
  "P" = "Pending",
  name = "status"
)

# Forward: code -> label
fputc(c("A", "I", "P"), "status")
# [1] "Active" "Inactive" "Pending"

# Reverse: label -> code
finputc(c("Active", "Pending", "Inactive"), "status_inv")
# [1] "A" "P" "I"
fclear()

ksformat documentation built on May 21, 2026, 9:07 a.m.