Description Usage Arguments Details Value Side effects Author(s) Examples
Convert a character vector to comma-separated list of quoted strings
1 2 3 4 5 6 7 8 9 |
char.vector |
a character vector containing one or more elements |
wrap |
logical or numeric value indicating whether the string should be wrapped at a given width. If TRUE, wrap at 0.9*getOption("width"); if FALSE do not wrap; if numeric, wrap at that number of characters. The output will be broken after the comma separators. |
var.name |
character string to be prepended to the output; typically the name of a variable to which the output will be assigned. |
prefix |
character string that will be inserted between the var.name and the commas-separated quoted list; default is ' <- c('. |
indent |
integer indicating number of spaces by which to indent all lines except the first; default is 3. |
suffix |
character string to append after the commas-separated list; default is ')'. If prefix is set to "" (empty string), suffix will automatically be set to that as well. |
sep |
character string indicating the separator between elements; defaults to '", "' (don't forget the double quotes) |
This is a handy function for creating a c("element1", "element2", "etc") expression from a character vector that can them be pasted into your code. Note that it returns a single element character vector not an expression object.
a character value containing the input strings as a comma-separated quoted list, returned invisibly.
The output string is printed to standard out using cat()
M.W.Rowe, mwr.stats@gmail.com
1 2 3 | |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.