print blank in r

To print a blank (empty) space in R, you can use the cat() function with an empty argument or with the sep = "" option to remove any separators between arguments:

main.r
cat("")
cat(" ", sep = "")
27 chars
3 lines

You can also use the print() function with the quote = FALSE and na.print = "" options to print an empty string:

main.r
print("", quote = FALSE, na.print = "")
40 chars
2 lines

Alternatively, you can use the invisible() function to generate a blank output without printing anything to the console:

main.r
invisible()
12 chars
2 lines

related categories

gistlibby LogSnag