cap_a_word: Cap a Word

Description Usage Arguments Examples

View source: R/cap_a_word.R

Description

Find a word within a word and capitalize it.

Usage

1
2
cap_a_word(phrase, to_cap = c("id", "Id"), collapse = " ",
  no_sep = FALSE)

Arguments

phrase

A single element or phrase containing one or more of the elements in 'to_cap'

to_cap

A vector of words that, if contained in 'phrase', will be fully capitalized.

collapse

What separator should the whole thing be collapsed down with?

no_sep

The seperator is not a " " or a "_", we've got something like "thisId"

Examples

1
2
3
4
5
6
7
8
cap_a_word("this_id")
cap_a_word("this Id")
cap_a_word("this_id", collapse = "_")
cap_a_word("this_id", collapse = "")
cap_a_word("thisid", no_sep = TRUE)
cap_a_word("this.id")

words_to_cap <- c("Petal", "Width")

aedobbyn/dobtools documentation built on May 28, 2019, 2:33 a.m.