sanitizers | R Documentation |
Sanitizer and unsanitizer are needed because the ndjson
format requires that each line be a valid JSON object,
thus special characters must be escaped. The functions worke in such a way that the concatenation
unsanitizer(sanitizer())
corresponds to the identity function.
default_ndjson_sanitizer(string)
default_ndjson_unsanitizer(string)
string |
A character vector. |
The default sanatizer and unsanatizer are based on the following mapping:
Character | Replacement |
\ | \\ |
" | \" |
\r | \\r |
\n | \\n |
A character vector.
## Not run:
default_ndjson_sanitizer('This is \n an "example"')
default_ndjson_unsanitizer('This is \\n an \\"example\\"')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.