0

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.

firmo23
  • 7,490
  • 2
  • 38
  • 114

2 Answers2

2

Use the sep argument in paste:

paste("Mortgage Application (Form 1003)", "No", sep = '              ')
[1] "Mortgage Application (Form 1003)              No"
bs93
  • 1,236
  • 6
  • 10
  • Could u check this one? -edited the Q https://stackoverflow.com/questions/61971953/set-white-space-in-menuitem-title-in-shiny-dashboard – firmo23 May 23 '20 at 12:23
2

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"
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
  • Could u check this one? -edited the Q https://stackoverflow.com/questions/61971953/set-white-space-in-menuitem-title-in-shiny-dashboard – firmo23 May 23 '20 at 12:23