Function to extract unique elements of a vector and output example code to the console.

create_vector(
  x,
  inner = c("  \"", "\",\n"),
  outer = c("c(\n", ")"),
  na.rm = TRUE
)

Arguments

x

A vector of elements.

inner

A character vector with 1 the string to add before each element and 2 the string to add after each element.

outer

A character with 1 the string to add before all elements and 2 the string to add after all elements.

Value

Example code in the console.

Examples

create_vector( LETTERS[1:3] )
#> c(
#>    "A",
#>    "B",
#>    "C"
#>  )