| replace_html {textclean} | R Documentation |
Replace HTML Markup
Description
Replaces HTML markup. The angle braces are removed and the HTML symbol markup is replaced with equivalent symbols.
Usage
replace_html(x, symbol = TRUE, ...)
Arguments
x |
The text variable. |
symbol |
logical. If codeTRUE the symbols are retained with appropriate
replacements. If |
... |
Ignored. |
Details
Replacements for symbols are as follows:
| html | symbol |
| © | (c) |
| ® | (r) |
| ™ | tm |
| “ | " |
| ” | " |
| ‘ | ' |
| ’ | ' |
| • | - |
| · | - |
| ⋅ | [] |
| – | - |
| — | - |
| ¢ | cents |
| £ | pounds |
| € | euro |
| ≠ | != |
| ½ | half |
| ¼ | quarter |
| ¾ | three fourths |
| ° | degrees |
| ← | <- |
| → | -> |
| … | ... |
| | |
| < | < |
| > | > |
| & | & |
| " | " |
| ' | ' |
| ¥ | yen |
Value
Returns a vector with HTML markup replaced.
Examples
x <- c(
"<bold>Random</bold> text with symbols: < > & " '",
"<p>More text</p> ¢ £ ¥ € © ®"
)
replace_html(x)
replace_html(x, FALSE)
replace_white(replace_html(x, FALSE))
[Package textclean version 0.9.3 Index]