I want to be able to print each text element on a new line after one tab indent.
Desired Results
"A"
"B"
"C"
Code
LETTERS[1:3]
Output
[1] "A" "B" "C"
The newline character ( \n ) is called an escape sequence, and it forces the cursor to change its position to the beginning of the next line on the screen. This results in a new line.
The most commonly used are "\t" for TAB, "\n" for new-line, and "\\" for a (single) backslash character.
To do a line break in HTML, use the <br> tag.
You could use a combination of cat
and paste
(and the special characters \t
(tab) and \n
(newline)), e.g.:
cat(paste0("\t", LETTERS[1:3], "\n"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With