Print string and variable contents on the same line in R

前端 未结 8 1517
梦谈多话
梦谈多话 2020-12-07 07:35

Is there a way to print text and variable contents on the same line? For example,

wd <- getwd()
print(\"Current working dir: \", wd)

I c

8条回答
  •  误落风尘
    2020-12-07 07:59

    A trick would be to include your piece of code into () like this:

    (wd <- getwd())
    

    which means that the current working directory is assigned to wd and then printed.

提交回复
热议问题