combine_words_ptbr: Combine words using ptbr rules

View source: R/combine_words_ptbr.R

combine_words_ptbrR Documentation

Combine words using ptbr rules

Description

combine_words_ptbr() collapse words using ptbr rules. This function differ from knitr::combine_words() which uses oxford commas.

Usage

combine_words_ptbr(words, sep = NULL, last = NULL)

Arguments

words

a character vector with words to combine

sep

a character with the separator of the words. Default is NULL and insert ", "

last

a character vector with the last separator of the words. Default is NULL and insert " e "

Value

a character vector

Acknowledgment

combine_words_ptbr() uses transformers available in the excellent {glue} package

Examples


misc::ipak("glue")

# using in an ordinary text
feira <- c("banana", "maça", "pepino", "ovos")
glue("Por favor, compre: {combine_words_ptbr(feira)}")


misc documentation built on April 8, 2026, 9:10 a.m.