I have a character vector of identical elements:
vec <- c("AXAXAXA", "AXAXAXA", "AXAXAXA")
I would like to replace "X" with "Y" but leave one "X" behind in each string, different one in each string, so I get
vec_res <- c("AXAYAYA", "AYAXAYA", "AYAYAXA")
The strings are always the same and the number of elements (strings) in the vector is the same as the number of "X" in each string
I am new to sringr but I suspect there could be a smart way to do this.