r - 如何用 R 处理 csv 行的中断?
问题描述
我有一个需要在 R 中读取的 csv 文件,但是有些行在某些数据之间有空格,而且它不统一。
例如:
1213,2,"some_text",2323,353,"some_other_text", 454, 232, "final"
2313,2,"all_good_here",343,22,"but here it comes
the problem", 121, 232, "final"
1213,2,"some_text",2323,353,"some_other_text", 454, 232, "final"
当我使用 read.csv 从 R 中读取它时,第一列具有以下文本格式的值:
"1213",
"2313",
" the problem",
"1213"
所以这给我带来了很多问题:很难设置标题,结果数据框中的值错位等等。
有人知道如何处理吗?
解决方案
推荐阅读
- twitter-bootstrap - 如何为 Drupal 8.7 创建子主题 SASS Bootstrap 3.4.1?
- java - Java:如何更改 JTable 拖放 dropLine 颜色?
- phantomjs - 如何让 PhantomJSCloud 等待内容中嵌入的 javascript
- node.js - 使用 axios 上传图片的问题
- go - Golang 获取命令 tty 输出
- reactjs - 如何将 Bootstrap JS 和 Jquery JS 添加到 Next JS
- database - 蓝图和用户模型
- encryption - 静态 GCP Cloud Memorystore 数据加密
- c# - 我可以在 c# 的变量中使用第一个字母作为 $ 吗?
- c# - UWP 项目中的 Angular 应用程序不加载第二页