I'm trying to convert an r list containing names into a string for an sql insert for a Postgresql text[] column.
name_list <- list("bob smith", "joe bob", "jim bob")
The goal is to create an sql insert statement suck as:
INSERT INTO players (name) value ({"bob smith", "joe bob", "jim bob"})
I've tried:
> name_str <- paste('{', unlist(name_list), '}', collapse=", ")
Which produces:
[1] "{ bob smith }, { joe bob }, { jim bob }"
Any thoughts as to how I can produce: {"bob smith", "joe bob", "jim bob"} ?