Skip to contents

This function converts a named list to a string, with each element of the list on a separate line and with its name.

Usage

print_named_list(my_list)

Arguments

my_list

A named list to be converted to a string.

Value

A string with each element of the list on a separate line and with its name.

Examples

my_list <- list(a = 1, b = 2, c = 3)
print_named_list(my_list)
#> [1] "a: 1\nb: 2\nc: 3\n"