Learn R Programming

ggDNAvis (version 0.3.2)

vector_to_string: Join a vector into a comma-separated string (generic ggDNAvis helper)

Description

Takes a vector and condenses it into a single string by joining items with ",". Reversed by string_to_vector().

Usage

vector_to_string(vector, sep = ",")

Value

character. The same vector but as a comma-separated string (e.g. "1,2,3").

Arguments

vector

vector. A vector (e.g. c(1,2,3)) to convert to a string.

sep

character. The character used to separate values in the string. Defaults to ",". Do not set to anything that might occur within one of the values.

Examples

Run this code
vector_to_string(c(1, 2, 3, 4))
vector_to_string(c("These", "are", "some", "words"))
vector_to_string(3:5, sep = ";")

Run the code above in your browser using DataLab