Extracts (and merges) chunks of characters.
metdat(x, i, sep = "-", collapse = sep)
x
: A character vector.i
: Index specifying which chunks of characters will be extracted (and merged).sep
: Chunks separator character. Defaults to "-".collapse
: New chunks separator character. Default to 'sep'.A character vector with the extracted (and merged) chunks of characters.
x <- "this is one chunk of characters & this is another one" metdat(x, 1, " & ") metdat(x, 2, " & ") metdat(x, c(1, 2), " & ") metdat(x, c(1, 2), " & ", " and ")