If have encountered a problem when trying to use recode
on a dot. This attempt
library(tidyverse)
x <- c("a", ",", ".")
recode(x, a = "A", "," = "comma", "." = "dot")
fails for the dot (works for "a" and ",") with error message
Error: Argument 2 must be named, not unnamed
Escaping the dot does clear the error, but the dot is not recoded.
recode(x, a = "A", "," = "comma", "\\." = "dot")
[1] "A" "comma" "."
Any ideas how to recode a dot?