string_functions: Functions for Creating or Manipulating Strings

Description Usage Arguments Details Value Author(s) Examples

Description

See Details for a description of the individual functions.

Usage

1
2
3

Arguments

x

a vector for collapseVec, otherwise a string.

space

logical; if TRUE, items will be separated by spaces after commas.

quote

logical; if TRUE, items will be quoted.

as.expr

logical; if TRUE, return a string which can be parsed as an expression.

depth

a non-negative integer.

Details

collapseVec returns a string representing a vector, intended for printing or for entry as a value. The elements of the vector (“items”) are separated by commas and enclosed by parentheses.

notification returns x with the time and date appended, and depth tabs prepended.

upperFirst returns a version of x with the first letter (if any) in the string in upppercase.

Value

A string.

Author(s)

Daniel Dvorkin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
collapseVec(1:3) # "(1, 2, 3)"
collapseVec(1:3, as.expr=TRUE) # "c(1, 2, 3)"
evpat(collapseVec(1:3, as.expr=TRUE))^2 # [1] 1 4 9

notification("hello, world")
# "hello, world @ 2012-10-08 19:10:21 MDT"

message(notification("goodbye, cruel world", 2))
#         goodbye, cruel world @ 2012-10-08 19:11:05 MDT

upperFirst(collapseVec(c("spam", "eggs"))) # "(Spam, eggs)"

lcmix documentation built on May 2, 2019, 6:49 p.m.