emend_lvl_match | R Documentation |
Match the input factor to supplied levels.
emend_lvl_match(.f, levels = NULL, chat = get_default_chat())
.f |
A vector of characters or a factor. |
levels |
The levels of the factor. |
chat |
The chat object defined by ellmer. |
A named character vector of standardised category labels, with the class "emend_lvl_match"
.
The names correspond to the original messy categories, and the values are the cleaned versions.
chat <- ellmer::chat_ollama(model = "llama3.1:8b", seed = 0, echo = "none")
emend_lvl_match(messy$country,
levels = c("Asia", "Europe", "North America", "Oceania",
"South America"),
chat = chat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.