View source: R/compare_sentences.R
compare_sentences | R Documentation |
This function produces a LaTeX mark up that highlights text differences between two input sentences.
compare_sentences( sentence1, sentence2, highlight_diff = "underline", NA.string = c("n/a", "na", "N/A", "NA", "Not applicable", "not applicable", "Not Applicable") )
sentence1 |
Original text |
sentence2 |
Revised text |
highlight_diff |
Font type used to highlight text differences. Defaults to |
NA.string |
String defining characters recognised as "NA". |
A LaTeX formatted string showing text differences when rendered.
Phil J. Bouchet
library(respondR) library(tidyverse) compare_sentences(sentence1 = "My name is Patricia.", sentence2 = "My name is Stacey.", highlight_diff = "underline", NA.string = c("n/a", "na", "N/A", "NA")) compare_sentences(sentence1 = "The sky is blue and the grass is green.", sentence2 = "The ocean is blue and the apples are green!", highlight_diff = "underline", NA.string = c("n/a", "na", "N/A", "NA", "Not applicable", "not applicable", "Not Applicable")) compare_sentences(sentence1 = "My tailor is rich, and those flowers are beautiful!", sentence2 = "Their tailor is very wealthy, and these flowers are beautiful!", highlight_diff = "underline", NA.string = c("n/a", "na", "N/A", "NA"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.