Learn R Programming

wrapr (version 2.1.0)

map_to_char: format a map.

Description

format a map.

Usage

map_to_char(mp, ..., sep = " ", assignment = "=", quote_fn = base::shQuote)

Value

character formatted representation

Arguments

mp

named vector or list

...

not used, foce later arguments to bind by name.

sep

separator suffix, what to put after commas

assignment

assignment string

quote_fn

string quoting function

See Also

Examples

Run this code

cat(map_to_char(c('a' = 'b', 'c' = 'd')))
cat(map_to_char(c('a' = 'b', 'd', 'e' = 'f')))
cat(map_to_char(c('a' = 'b', 'd' = NA, 'e' = 'f')))
cat(map_to_char(c(1, NA, 2)))

Run the code above in your browser using DataLab