Skip to contents

This function splits a character vector of any length into a matrix with n rows of x elements. This is to get around the 20 field limit imposed by the API. When necessary removes duplicates and fills columns with NA values. Adapted from https://stackoverflow.com/a/48930537

Usage

split_vector_unique(x, n)

Arguments

x

A character vector

n

The number of elements (strings) in each column

Examples

split_vector_unique(x= sample(c("April", "is", "the","cruellest","month","breeding",
"lilacs"), size = 40, replace = TRUE), n =5)
#> Error in split_vector_unique(x = sample(c("April", "is", "the", "cruellest",     "month", "breeding", "lilacs"), size = 40, replace = TRUE),     n = 5): could not find function "split_vector_unique"