For this code below ( in python) What is the equivalent code in R?
print("Sammy is a {}, {}, and {} {}!".format("happy", "smiling", "blue", "shark"))
For this code below ( in python) What is the equivalent code in R?
print("Sammy is a {}, {}, and {} {}!".format("happy", "smiling", "blue", "shark"))
There are multiple ways. We may use sprintf from base R
sprintf("Sammy is a %s, %s and %s %s!", "happy", "smiling", "blue", "shark")
[1] "Sammy is a happy, smiling and blue shark!"
Or may use paste/glue considering these are objects created in the global env