Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

caplow

Functions for strings


Description

capply Apply function to elements in character vector (utility function) cap and capitalize change to capital letters. lower and lowerize change to lower case letters. CapLeading Capitalizes the first character of each element of a character vector

Usage

capply(str,ff,...)
cap(char)
capitalize(str)
lower(char)
lowerize(str)
CapLeading(str)
strReverse(str)

Arguments

str

a character vector.

ff

a function.

...

additional parameters for function ff.

char

a single letter.

strReverse

the reverse of str

Value

The same type as the argument.

Note

capply has been reverse engineered from the help page on strsplit. strReverse <- function(x) capply( x, rev )

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>

Examples

# capitalize shows the use of capply
  cap("f")    # "F"
  capitalize(c("TruE","faLSe"))  # "TRUE"  "FALSE"
  lower("R")  # "r"
  lowerize("TruE")  # "true"
  CapLeading(c("all you ","need"))     # "All you " "Need"
  capply(c("abc", "elephant"), rev)  # "cba"    "tnahpele"

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.