粘的时候想str_glue
留着\
,但是不知道怎么逃。
我reprex
所做的合乎逻辑的尝试是这样的:(逃避逃跑等)
library(stringr)
var <- "darkness"
str_glue("Hello {var} my old friend \
I've come to talk with you again")
#> Hello darkness my old friend
#> I've come to talk with you again
str_glue("Hello {var} my old friend \\
I've come to talk with you again")
#> Hello darkness my old friend I've come to talk with you again
str_glue("Hello {var} my old friend \\\
I've come to talk with you again")
#> Hello darkness my old friend I've come to talk with you again
由 reprex 包于 2021-04-28 创建 (v2.0.0)
我想要的输出:
"Hello darkness my old friend \
I've come to talk with you again"