txt | R Documentation |
This function generates custom text and provides the option to include an optional count that can be integrated into the text. It creates an HTML span element with a unique identifier (ID). This identifier can be used for customizing the appearance of the text using CSS code. Default identifiers are "text_issue", "text_inspect", "text_mod". To use it, simply call the function within inline code, do not call this function within a chunk.
txt(
id = "text_issue",
title = "Issue",
text = "",
count = TRUE,
output_file = NULL
)
id |
A character string specifying the unique identifier for the HTML span element. Default identifiers are "text_issue", "text_inspect", "text_mod". |
title |
A character string containing the text to display. |
text |
Descriptive text. |
count |
A logical value indicating whether to include a count in the text. |
output_file |
A character string specifying the json file should be created. If not provided, the template will be copied to the current working directory. |
A character string containing the HTML span element with the specified ID and text.
if (interactive()) {
# In RMarkdown, use 'r txt()`.
# Do not call this function within a chunk
txt("text_issue", "Issue", text = "Wrong participant number")
txt("text_mod", "Modification", text = "Change the participant number from 1 to 32",
count = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.