cc {err}R Documentation

Concatenation with Commas

Description

Concatenates object values into a string with each value separated by a comma and possibly the last value separated by a conjunction.

Usage

## Default S3 method:
cc(object, conjunction = NULL, bracket = "",
  ellipsis = 10, oxford = FALSE, ...)

## S3 method for class 'character'
cc(object, conjunction = NULL, bracket = "'",
  ellipsis = 10, oxford = FALSE, ...)

## S3 method for class 'factor'
cc(object, conjunction = NULL, bracket = "'",
  ellipsis = 10, oxford = FALSE, ...)

## S3 method for class 'data.frame'
cc(object, conjunction = NULL, ellipsis = 10,
  oxford = FALSE, ...)

Arguments

object

The object with values to concatenate.

conjunction

A string of the conjunction to separate the last value by or NULL.

bracket

A string to bracket the values by.

ellipsis

A count of the total number of values required to use an ellipsis.

oxford

A flag indicating whether to use the Oxford comma (if conjunction).

...

Unused

See Also

co

Examples

cc(c(1,1,1:2))
cc(100:1)
cc(1:100, "and")
cc(100:1, "or", bracket = "|", ellipsis = 5, oxford = TRUE)
cc(mtcars)

[Package err version 0.2.0 Index]