I am simply pasting two strings but the created new line is not platform specific but always "\n".
I was expecting that the new line is converted to the platform specific code(s) where R is running:
charToRaw(paste0("a", "\n", "b"))
[1] 61 0a 62
I would expect
[1] 61 0d 0a 62
on Windows and
[1] 61 0a 62
on all other platforms.
How can I achieve this without explicitly using the correct platform-specific new line code(s)?
PS: I do not want to hard code "\r\n" to stay platform-independent...
See also: New line constant
Edit 1: Even when I print the string the "\n" is not converted to "\r\n" on Windows: charToRaw(print(paste0("a", "\n", "b")))