Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vector2string

Collapse vector to string


Description

Merges all the values and outputs a string formatted as '1st element', '2nd element', ...

Usage

vector2string(
  x,
  quotation_mark = "'",
  collapse = sprintf("%s, %s", quotation_mark, quotation_mark)
)

Arguments

x

The vector to collapse

quotation_mark

The type of quote to use

collapse

The string that separates each element

Value

A string with ', ' separation

Examples

vector2string(1:4)
vector2string(c("a", "b'b", "c"))
vector2string(c("a", "b'b", "c"), quotation_mark = '"')

htmlTable

Advanced Tables for Markdown/HTML

v2.1.0
GPL (>= 3)
Authors
Max Gordon [aut, cre], Stephen Gragg [aut], Peter Konings [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.