dbosak01 / fmtr

An R package for formatting data.
12 stars 1 forks source link

fapply with single item lookup #63

Closed dbosak01 closed 2 months ago

dbosak01 commented 3 months ago

fapply() with a single item vector lookup doesn't work. Gives a warning in sprintf.

fmt <- c("A"= "Group A")

fapply(c("A", "B", "C"), fmt)
# [1] "Group A" "Group A" "Group A"
# Warning message:
# In sprintf(fmt, x) : one argument not used by format 'Group A'