Learn R Programming

linea (version 0.1.1)

get_vector_from_str: get_vector_from_str

Description

get a numeric vector from string (e.g. '1,2,3')

Usage

get_vector_from_str(string, sep = ",", zero = TRUE)

Value

numeric vector from the string

Arguments

string

a string containing separated by a separator

sep

a string representing the separator

zero

a boolean defining whether the output vector must contain a zero

Details

Get a numeric vector from string containing numbers separated by a separator (e.g. '1,2,3').

Examples

Run this code
get_vector_from_str('1,2,3')
get_vector_from_str('0.1')
get_vector_from_str('1;2;3',sep=';')

Run the code above in your browser using DataLab