str_spine_case: str_spine_case

Description Usage Arguments Examples

View source: R/str_spine_case.R

Description

Function used to convert character vectors to spine case format.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
str_spine_case(
  string,
  whitespace = getOption("lettercase.whitespace", "[\\s-_]"),
  collapse.whitespace = getOption("collapse.whitespace", TRUE)
)

str_spinal_case(
  string,
  whitespace = getOption("lettercase.whitespace", "[\\s-_]"),
  collapse.whitespace = getOption("collapse.whitespace", TRUE)
)

str_hyphen_case(
  string,
  whitespace = getOption("lettercase.whitespace", "[\\s-_]"),
  collapse.whitespace = getOption("collapse.whitespace", TRUE)
)

Arguments

string

object to turn into a title case

whitespace

character; regular expression pattern for matching whitespace characters

collapse.whitespace

logical; whether adjacent whitespace is collapsed

  • characters are all lower case

  • non- \w, \s and - are dropped

  • \w and - are converted to underscore

  • no support for acronyms

Examples

1
2
3
4
  str_spine_case( "One Flew Over The Cuckoo's Nest" ) # One Flew Over The Cuckoo's Nest
  str_spine_case( "Catch 22" )  # catch-22
  str_spine_case( "Catch_ 22" )  
  

decisionpatterns/lettercase documentation built on May 23, 2020, 4:39 p.m.