r - .tsv 文件中的表情符号正在破坏 read.table() 并添加行
问题描述
当 read.table 在文本数据中遇到表情符号时,它会过早地插入几个 EOL,然后再继续一个新行,该行以它被中断的同一行上的数据开头。
尝试对 read.table、read.delim 上的参数进行排列
myData <- read.table("myData.tsv", sep = '\t', encoding = "UTF-16", skipNul = TRUE, fill = TRUE, header = TRUE, skip = 3, quote = "", stringsAsFactors = FALSE)
使用此数据集复制:
StartDate Q15.5 Q16.5 gc response_order
Start Date Which of these statements best reflect how you feel about [Brand]? [Brand] is _____. "In your own words, why do you feel that [Brand] is [QID32-ChoiceGroup-SelectedChoices]?" gc response_order
"{""ImportId"":""startDate"",""timeZone"":""America/Denver""}" "{""ImportId"":""QID32""}" "{""ImportId"":""QID33_TEXT""}" "{""ImportId"":""gc""}" "{""ImportId"":""response_order""}"
4/4/2019 9:39 Holding its ground i dont really hear much about it but i would assume its holding its ground 1 reversed
4/4/2019 9:37 Probably on its way up 1 reversed
4/4/2019 9:29 Probably on its way up Growing company 1 normal
4/4/2019 9:37 Holding its ground "It is mostly geared towards the younger generation, which is good because it calls to new customers. On the other hand, the older generations are moving on to business that more geared towards us." 1 normal
4/4/2019 9:17 Probably on its way up Its well used and good 1 reversed
4/4/2019 9:41 Probably on its way up Its going good 1 normal
4/4/2019 9:38 Definitely on its way up reasons 1 normal
4/4/2019 9:38 Holding its ground It's beginning to look less like a fly by night outfit and more like a responsible company 1 normal
4/4/2019 9:38 Holding its ground "I feel that the company, while providing a useful service, is not constantly working to innovate and continue building upon the product to match the needs of the customer." 1 reversed
4/4/2019 9:37 Definitely on its way up They are a trustworthy company that constantly stays in tune with the technology of today 1 normal
4/4/2019 9:48 Holding its ground I still hear about it 1 normal
导致:
"X....ImportId.....startDate.....timeZone.....America.Denver....","X....ImportId.....QID32....","X....ImportId.....QID33_TEXT....","X....ImportId.....gc....","X....ImportId.....response_order...."
"4/4/2019 9:39","Holding its ground","i dont really hear much about it but i would assume its holding its ground ",1,"reversed"
"4/4/2019 9:37","Probably on its way up","=ØhÜ<Øþß",NA,""
" <Ø>ß=ØÞ>Ø/Ý=ØhÜ<Øþß","","",NA,""
" <Ø>ß>Ø/Ý=ØÞ>Ø/Ý=ØÞ>Ø/Ý","1","reversed",NA,""
"4/4/2019 9:29","Probably on its way up","Growing company",1,"normal"
"4/4/2019 9:37","Holding its ground","""It is mostly geared towards the younger generation, which is good because it calls to new customers. On the other hand, the older generations are moving on to business that more geared towards us.""",1,"normal"
"4/4/2019 9:17","Probably on its way up","Its well used and good",1,"reversed"
"4/4/2019 9:41","Probably on its way up","Its going good",1,"normal"
"4/4/2019 9:38","Definitely on its way up","reasons",1,"normal"
"4/4/2019 9:38","Holding its ground","It's beginning to look less like a fly by night outfit and more like a responsible company",1,"normal"
"4/4/2019 9:38","Holding its ground","""I feel that the company, while providing a useful service, is not constantly working to innovate and continue building upon the product to match the needs of the customer.""",1,"reversed"
"4/4/2019 9:37","Definitely on its way up","They are a trustworthy company that constantly stays in tune with the technology of today",1,"normal"
"4/4/2019 9:48","Holding its ground","I still hear about it ",1,"normal"
解决方案
推荐阅读
- django - 如何让用户名显示在序列化程序 django rest 框架上
- swiftui - SwiftUI 显示/隐藏部分
- css - 溢出如何与 flex-basis 一起工作
- javascript - 语音识别如何识别 5 和 5 之间的差异?
- javascript - 我们如何在 React 应用程序中绘制流程图?
- python - 使用 DIV 标签动态构建结构化 HTML 表的问题
- javascript - FlexBoxLayout align-self:flex-end 在 nativescript-vue 中不起作用
- python - 下一个词预测 RNN
- android - Android - AAR 文件导致错误
- javascript - 我的浏览器中的 Minifier js 导致变量已被声明