split_text | R Documentation |
This function splits a text string into a vector of strings with a specified number of tokens each.
split_text(text, N)
text |
A character vector containing the text to be split. |
N |
An integer specifying the number of tokens per chunk. |
A character vector containing the chunks of text with N tokens each.
large_text <- "This is an example of a large text string
that will be split into chunks of N tokens each by our custom R function."
num_tokens_per_chunk <- 5
split_text(large_text, num_tokens_per_chunk)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.