
Convert an R object to an eon-formatted string.
format_eon.RdSerializes an R object into an eon-formatted character string. Named lists become maps, unnamed lists become arrays, and R scalars map to their eon equivalents.
Examples
format_eon(list(name = 'Alice', age = 30L))
#> [1] "name: \"Alice\"\nage: 30\n"
format_eon(list(scores = list(1L, 2L, 3L)))
#> [1] "scores: [1, 2, 3]\n"
format_eon(list(active = TRUE, ratio = 0.5))
#> [1] "active: true\nratio: 0.5\n"
format_eon(list(name = 'Alice', age = 30L), indent = ' ')
#> [1] "name: \"Alice\"\nage: 30\n"