proper: Converting a string to first letter capitalised, all other...

View source: R/multiple_response_plots.R

properR Documentation

Converting a string to first letter capitalised, all other letters little.

Description

This function does the same as the Excel function PROPER(string)

Usage

proper(x, type = "cto")

Arguments

x

A character vector

type

String, either 'excel' or 'cto'

Value

The same character vector but every letter at the beginning of after a blank is capitalised. If type = 'cto' also the two digits and all underscores are removed

Examples

proper(c("wOrds", "many words", "verymany many Words"))
[1] "Words"               "Many Words"          "Verymany Many Words"

proper(c( "01_farmer",  "02_merchant", "03_health_worker"))
[1] "Farmer"        "Merchant"      "Health Worker"


SCIFoundation/sciCoverageR documentation built on Oct. 31, 2024, 11:45 p.m.