hl_diff | R Documentation |
Highlight the differences between two strings in
terms of substitutions, insertions and deletions calculated by
the generalized Levenshtein (edit) distance (using adist()
)
hl_diff(
x,
y,
coerce = "default",
fill = NULL,
text = NULL,
opts = hl_opts(),
sep = NULL,
...
)
x , y |
each argument is a single string. vectors of strings not currently supported. |
coerce |
How should non-character arguments be coerced to character strings?
|
fill |
named list of colours for substitutions, insertions and deletions with names 'sub', 'ins' and 'del'. If set to NULL (the default) then default colours will be used. |
text |
named list of colours for the text for 'sub', 'ins' and 'del'
operations. If |
opts |
create options list |
sep |
character string of the line separating the two objects. Default: |
... |
further arguments passed to |
This works character-by-character, so the displayed difference for multiline strings can be quite busy if there are a lot of changes.
list of 'emphatic' objects which could be rendered to ANSI (for example)
hl_diff('hello', 'there')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.