Assuming
pradeep <- "Pradeep"
Try the following:
cat("My name is", pradeep, "\n")
In addition, the gsubfn package has the ability to add any quly perl-style line interpolation to any command, previously using the fn$ command
library(gsubfn) fn$cat("My name is $pradeep\n") fn$print("My name is $pradeep")
There is also sprintf and paste , as mentioned by others.
source share