On my computer:
str_sub("TKQTAR", 2, 2) <- "Kme1"; x
returns
Error in str_sub(“TKQTAR”, 2, 2) <- “Kme1” :
target of assignment expands to non-language object
while if I write the same code passing the string as an argument it works.
x <- "TKQTAR"
str_sub(x, 2, 2) <- "Kme1"; x
returns “TKme1QTAR”
why is that?