recombine_with_sep_closure: Return a function that will combine/contatenate a vector

View source: R/split-map-filter-reduce.R

recombine_with_sep_closureR Documentation

Return a function that will combine/contatenate a vector

Description

This function takes and optional separator, and returns a function that takes a vector and pastes the elements of that vector together

Usage

recombine_with_sep_closure(sep = ";")

Arguments

sep

A character to use in between the elements (default is a semicolon character)

Details

Can be used as a reduction function in split_map_filter_reduce

Value

Returns a closure/function

See Also

split_map_filter_reduce

paste

Examples


lambda <- recombine_with_sep_closure()
lambda(c(8, 6, 7))                               # "8;6;7"

# directly
recombine_with_sep_closure()(c(8,6,7))           #  "8;6;7"
lambda <- recombine_with_sep_closure(" ")
lambda(c("this", "that", NA,"the-other"))        # "this that NA the-other"


libbib documentation built on Nov. 10, 2022, 6:16 p.m.