我已经将一个csv文件加载到名为my_data的r中。但是某些列具有多个字段,我想将它们拆分为单独的新列。执行此命令时:
separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews",
"TransactionRevenue", "NewVisits"),sep=”,”)
我收到此错误消息:
Error: unexpected symbol in "separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews", "TransactionRevenue”, "NewVisits"
我正在尝试找出问题所在,但没有成功。有帮助吗?
答案 0 :(得分:1)
似乎sep =具有智能引号,而不是直引号。尝试将其更改为
separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews",
"TransactionRevenue", "NewVisits"),sep=",")