Convert an arbitrary R object to a string

coerce_to_string(x, coerce)

Arguments

x

object

coerce

How should non-character arguments be coerced to character strings?

default

- the given object x must already be a character string

character

- performs the matching after first calling as.character(x)

print

- performs the matching against the default print(x) output

deparse

- performs the matching after first calling deparse1(x)

str

- performs the matching on the output of calling str(x)