## String to numeric vector (default)
string_to_vector("1,2,3,4")
string_to_vector("1,2,3,4", type = "numeric")
string_to_vector("1;2;3;4", sep = ";")
## String to character vector
string_to_vector("A,B,C,D", type = "character")
## String to logical vector
string_to_vector("TRUE FALSE TRUE", type = "logical", sep = " ")
## By default, vector inputs are concatenated
string_to_vector(c("1,2,3", "4,5,6"))
## To create a list of vector outputs, use lapply()
lapply(c("1,2,3", "4,5,6"), string_to_vector)
Run the code above in your browser using DataLab