我遇到了以下行为: import rpy2.robjects as robjectsrobjects.r('''print(paste("Output fromR with format and paste:",{}))'''.format(string_to_pass)) 将给出以下输出: [1] "Output from R wi
There were x1 (a=\`r a(x1)\`; b=\`r b(x1)\`) and x2 (a=\`r a(x2)\`; b=\`r b(x2)\`)foo <- function(x) paste('a = ',a(x), '; b = ', b(x))
现在我可以编写There were x1 (`r foo(x1)`) and x2