x <- 1; y <- 2
cat(pp("1 + #{x} = #{1 + x}")) # "1 + 1 = 2"
cat(pp(1:3, " are numbers")) # "123 are numbers"
cat(pp(1:3, " are numbers", collapse = " and "))
# "1 and 2 and 3 are numbers"
cat(pp("x = #{x}", "y = #{y}", "x + y = #{x + y}", sep = ", "))
# x = 1, y = 2, x + y = 3
Run the code above in your browser using DataLab