| fputn | R Documentation |
Looks up a numeric VALUE format by name from the global format library and applies it to the input vector.
fputn(x, format_name, ...)
x |
Numeric vector of values to format |
format_name |
Character. Name of a registered numeric format,
or a character vector of format names (same length as |
... |
Additional arguments passed to |
Character vector with formatted labels
# Numeric range formatting
fparse(text = '
VALUE age (numeric)
[0, 18) = "Child"
[18, 65) = "Adult"
[65, HIGH] = "Senior"
.missing = "Age Unknown"
;
')
fputn(c(5, 25, 70, NA), "age")
# [1] "Child" "Adult" "Senior" "Age Unknown"
# SAS date format (auto-resolved, no pre-creation needed)
fputn(as.Date("2025-01-15"), "DATE9.")
# [1] "15JAN2025"
# Time format (seconds since midnight)
fputn(c(0, 3600, 45000), "TIME8.")
# [1] "00:00:00" "01:00:00" "12:30:00"
fclear()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.