metdat function

Extracts (and merges) chunks of characters.

Extracts (and merges) chunks of characters.

metdat(x, i, sep = "-", collapse = sep)

Arguments

  • 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'.

Returns

A character vector with the extracted (and merged) chunks of characters.

Examples

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 ")
  • Maintainer: Agustin Gonzalez-Reymundez
  • License: GPL-2
  • Last published: 2022-03-25