text_list | R Documentation |
This function alows you to take a string of words and combine them into a sentance list. For example, 'apples', 'oranges', 'pears' would become 'apples, oranges, and pears'. This function uses oxford commas.
text_list(x = "", oxford = TRUE, sep = ", ", sep_last = "and ")
x |
Character strings you want in your string. |
oxford |
T/F: would you like to use an oxford comma? Default = TRUE |
sep |
string. default = ", " but "; " or " " might be what you need! |
sep_last |
string. default = " and " but " & " or " , " might be what you need! |
text_list(c(1,2,"hello",4,"world",6))
text_list(c(1,"world"))
text_list(c(1,2,"hello",4,"world",6), oxford = FALSE)
paste0("here is a list of things: ",
text_list(paste0("list", 1:5), sep = " ", sep_last = ""))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.