You can use the paste function from the base package to print strings and variable contents on the same line, as follows:
wd <- getwd()
str <- paste("Current working directory is", wd, sep = " ")
str
Output:
[1] "Current working directory is C:/Users/intellipaat/Documents"
You can also use the stprintf() function as follows:
sprintf("Current working directory is %s", wd)
Output:
[1] "Current working directory is C:/Users/intellipaat/Documents"