举例说明:
> mylist <- c("1001", "2002", "3003") #imagine these are values in target table
> sQuote(mylist)
[1] "‘1001’" "‘2002’" "‘3003’"
> toString(sQuote(mylist))
[1] "‘1001’, ‘2002’, ‘3003’"
> paste( toString(sQuote(mylist)), sep="" collapse="" )
Error: unexpected symbol in "paste( toString(sQuote(mylist)), sep="" collapse"
>
为什么会出现此错误?我正在尝试构建字符串"'1001', '2002', '3003'"
答案 0 :(得分:2)
不确定这是否算作答案 - 你错过了一个逗号:
paste(toString(sQuote(mylist)), collapse = "")