我用的是 paste0()
来打印下面的文字,但我想通过使用许多空格来设置距离。(Form 1003)
和 No
paste0("Mortgage Application (Form 1003)",'','',"No",collapse = '').
结果应该是这样的。Mortgage Application (Form 1003)_______No. The________ is the white space.
使用 sep
参数。
paste("Mortgage Application (Form 1003)", "No", sep = ' ')
[1] "Mortgage Application (Form 1003) No"
你可以使用 strrep
paste0("Mortgage Application (Form 1003)",strrep(' ', 10),"No")
#[1] "Mortgage Application (Form 1003) No"
paste0("Mortgage Application (Form 1003)",strrep(' ', 20),"No")
#[1] "Mortgage Application (Form 1003) No"