Read.csv: some rows are missing
read.csv in R doesn't import all rows from csv file
The OP indicates that the problem is caused by quotes in the CSV-file.
When the records in the CSV-file are not quoted, but only a few records contain quotes. The file can be opened using the quote="" option in read.csv. This disables quotes.
data <- read.csv(filename, quote="")
Another solution is to remove all quotes from the file, but this will also result in modified data (your strings don't contain any quotes anymore) and will give problems of your fields contain comma's.
lines <- readLines(filename)
lines <- gsub('"', '', lines, fixed=TRUE)
data <- read.csv(textConnection(lines))
A slightly more safe solution, which will only delete quotes when not just before or after a comma:
lines <- readLines(filename)REF:
lines <- gsub('([^,])"([^,])', '\\1""\\2', lines)
data <- read.csv(textConnection(lines))
https://stackoverflow.com/questions/26094584/read-csv-in-r-doesnt-import-all-rows-from-csv-file
Read.csv: some rows are missing的更多相关文章
- highcharts自定义导出文件格式(csv) highcharts的一些使用心得
highcharts是国外的一个图表插件,包括各种数据图形展示,柱形图,线性图等等,是手机端和pc端最好的图表插件之一,相比于百度的echarts更加轻便和易懂.链接http://www.hchart ...
- Django生成CSV文件
1.生成CSV文件 有时候我们做的网站,需要将一些数据,生成有一个CSV文件给浏览器,并且是作为附件的形式下载下来.以下将讲解如何生成CSV文件. 2.生成小的CSV文件 这里将用一个生成小的CSV文 ...
- 108.生成和下载csv文件
生成CSV文件 有时候我们做的网站,需要将一些数据,生成一个csv文件返回浏览器,并且是作为附件的形式下载下来. 生成小的csv文件: 生成一个小的csv文件,我们用Python内置的csv模块来处理 ...
- 一文综述python读写csv xml json文件各种骚操作
Python优越的灵活性和易用性使其成为最受欢迎的编程语言之一,尤其是对数据科学家而言.这在很大程度上是因为使用Python处理大型数据集是很简单的一件事情. 如今,每家科技公司都在制定数据战略. ...
- Random Forest Classification of Mushrooms
There is a plethora of classification algorithms available to people who have a bit of coding experi ...
- Azure Machine Learning
About me In my spare time, I love learning new technologies and going to hackathons. Our hackathon p ...
- Getting started with machine learning in Python
Getting started with machine learning in Python Machine learning is a field that uses algorithms to ...
- Getting started with Kaggle -- Kaggle Competitions
1: The Competition We'll be learning how to generate a submission for a Kaggle competition. Kaggle i ...
- (zhuan) Using convolutional neural nets to detect facial keypoints tutorial
Using convolutional neural nets to detect facial keypoints tutorial this blog from: http://danieln ...
随机推荐
- table 的rolspan和rowspan
如图所示啦,容易让初学者混乱的两个东西仔细看看分析下呢,就比较简单了 <table width="300" border="2"> <tr&g ...
- 【2017-03-20】HTML基础知识,标记,表格,表格嵌套及布局,超链接
一.HTML 网站(站点),网页基础知识 HTML是一门编程语言的名字:超文本标记语言 可以理解为:超越了文本的范畴,可以有图片.视频.音频.动画特效等其他内容,用标记的方法进行编程的计算机语言 基 ...
- 富文本编辑器kindeditor插件
官网:http://kindeditor.net/doc.php 步骤
- Jersey入门——注解的使用
本文主要解释Jersey中各种注解的使用 package com.coshaho.learn.jersey; import java.net.URI; import javax.ws.rs.Consu ...
- springmvc静态资源无法加载
springmvc拦截所有请求,用/: <servlet> <servlet-name>springmvc</servlet-name> <servlet-c ...
- ATM取款机
package Tests; import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;impo ...
- Numpy 基本除法运算和模运算
基本算术运算符+.-和*隐式关联着通用函数add.subtract和multiply 在数组的除法运算中涉及三个通用函数divide.true_divide和floor_division,以及两个对应 ...
- Linux 进程管理 ps、top、pstree命令
ps命令:查看系统中正在运行的进程 ps 是用来静态地查看系统中正在运行的进程的命令.不过这个命令有些特殊,它的部分选项不能加入"-",比如命令"ps aux" ...
- 前端框架VUE----模板字符串
传统的JavaScript语言,输出模板通常是这样的写的. 1 $('#result').append( 2 'There are <b>' + basket.count + '</ ...
- SpringMVC之数据绑定
SpringMVC之数据绑定 #数据绑定:Spring MVC会根据客户端请求参数的不同,将请求信息以一定的方式转换并绑定 到控制器类中的方法参数上. #说明:这里的“以一定的方式”应该指的是什么?过 ...