Learn R Programming

descutils (version 1.0)

wrapQuote: wrap all elements in a vector in quotes (or other strings)

Description

wrap all elements in a vector in quotes (or other strings)

Usage

wrapQuote(v, quoteChr = "'", endquoteChr = NULL)

Value

character vector of the elements of v wrapped between quotes

Arguments

v

vector of elements to wrap

quoteChr

character. to be put around of the elements of v. Defaults to "'".

endquoteChr

character or NULL (default). If not NULL quoteChr is put before the elements of v and endquoteChr is put after them

Author

Andreas Leha

Examples

Run this code
## default behaviour: wrap in single quotes
wrapQuote(1:10)

## change to wrap in asterisks
wrapQuote(1:10, "*")

## different front from back quotes
wrapQuote(1:10, "*", "/")

## you can also wrap with longer strings
wrapQuote(1:10, "quote")

Run the code above in your browser using DataLab