implode: Create a character string by concatenating the elements of a...

Description Usage Arguments Value Author(s) References See Also Examples

Description

Create a character string by concatenating the elements of a vector, using a separator and optional final separator.

Usage

1
implode(strings, sep = "", finalSep = NULL, ranges = FALSE)

Arguments

strings

A vector, which will be coerced to mode character.

sep

A unit length character vector giving the separator to insert between elements.

finalSep

An optional unit length character vector giving the separator to insert between the final two elements.

ranges

Logical value. If TRUE and strings can be interpreted as integers, collapse runs of consecutive numbers into range notation.

Value

A character vector of length one.

Author(s)

Jon Clayden

References

Please cite the following reference when using TractoR in your work:

J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. http://www.jstatsoft.org/v44/i08/.

See Also

paste

Examples

1
2
3
4
implode(1:3, ", ")  # "1, 2, 3"
implode(1:3, ", ", " and ")  # "1, 2 and 3"
implode(1:2, ", ", " and ")  # "1 and 2"
implode(1:3, ", ", ranges=TRUE)  # "1-3"


Search within the tractor.base package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.