Learn R Programming

err (version 0.2.0)

cc: 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

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

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

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

# S3 method for 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

Run this code
# NOT RUN {
cc(c(1,1,1:2))
cc(100:1)
cc(1:100, "and")
cc(100:1, "or", bracket = "|", ellipsis = 5, oxford = TRUE)
cc(mtcars)
# }

Run the code above in your browser using DataLab