Possible Duplicate:
What is the difference between \r and \n?
Hi,
What is difference between \n
(newline) and \r
(carriage return)? They both move current cursor to the next line. Are they same?
historically a \n was used to move the carriage down, while the \r was used to move the carriage back to the left side of the page.
\n means new line. It means that the cursor must go to the next line. \r means carriage return. It means that the cursor should go back to the beginning of the line.
The C programming language provides the escape sequences '\n' (newline) and '\r' (carriage return). However, these are not required to be equivalent to the ASCII LF and CR control characters.
The R function duplicated() returns a logical vector where TRUE specifies which elements of a vector or data frame are duplicates. ! is a logical negation. ! duplicated() means that we don't want duplicate rows.
\r
returns the cursor to the beginning of the line, NOT to the next line. When you use \n
in Linux, \r
is implied, in windows, it is not.
Using \r
in Unix-like systems may result in overwriting the same line.
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