0
votes

I use paste0() to print the text below but I want to set distance by using many spaces between (Form 1003) and No

paste0("Mortgage Application (Form 1003)",'','',"No",collapse = '').

The result should be like: Mortgage Application (Form 1003)________No. The________ is the white space.

2

2 Answers

2
votes

Use the sep argument in paste:

paste("Mortgage Application (Form 1003)", "No", sep = '              ')
[1] "Mortgage Application (Form 1003)              No"
2
votes

You can add variable number of spaces using 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"