Clean a vector of delimited strings
clean_dvec(vec, sep = ";")
A vector of delimited strings to clean
String - delimiter used within each element of the vector to be cleaned
This function handles cases where delimited data is stored within each element of a vector. Such vectors are in a sense vectors of vectors, though each element is stored as a delimited string. In addition, these vectors resemble lists, which can store a sequence of vectors. The function will loop through each element of the input vector, check for the presence of a string containing the specified delimiter, split the element string apart by the delimiter, attempt to convert to numeric, and then sort the unique values contained within the split string.
Vector - the cleaned input vector, with each element consisting of sorted, unique elements
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.