我有一个这样的字符串:
str1 <- "get all securities in portfolio port1 on date 2010-12-31 where field value of Close on 2010-12-31+10 less than 2000"
我正在尝试将“2010-12-31+10”转换为str1
. 我尝试str_replace_all
了stringr
打包的方法但我没有得到输出。
> str_replace_all(str1,"2010-12-31+10","2011-01-10")
[1] "get all securities in portfolio port1 on date 2010-12-31 where field value of Close on 2010-12-31+10 less than 2000"
这是什么原因?