get_time_points {disprofas}R Documentation

Get time points

Description

The function get_time_points() extracts the numeric information from a vector of character strings, if available.

Usage

get_time_points(svec)

Arguments

svec

A vector of character strings.

Details

The function expects a vector of character strings that contain numeric information. If the strings contain extractable numeric information a named numeric vector is returned, where the names are derived from the strings provided by svec. For example, from the vector c("t_0", "t_5", "t_10") the named numeric vector (0, 5, 10) is returned, where the names correspond to the original string. If a string does not contain any numeric information NA is returned.

Value

A vector of the same length as svec with the extracted numbers as numeric values.


[Package disprofas version 0.1.3 Index]