我正在尝试使用read.table() 将此TXT文件导入到R (包含由WMO提供的有关气象站的信息):
但是,当我尝试使用
tmp <- read.table(file=...,sep=";",header=FALSE)我得到这个错误
eof within quoted string' tmp '中只有6702条线条中的3514条出现。 从快速查看文本文件,我找不到任何看似有问题的字符。
正如其他线程所建议的,我也尝试过quote="" 。 EOF警告消失,但仍然只导入了3514行。
有关如何让read.table()为这个特定的txt文件工作的任何建议?
I am trying to use read.table() to import this TXT file into R (contains informations about meteorological stations provided by the WMO):
However, when I try to use
tmp <- read.table(file=...,sep=";",header=FALSE)I get this error
eof within quoted stringwarning and only 3514 of the 6702 lines appear in 'tmp'. From a quick look at the text file, I couldn't find any seemingly problematic characters.
As suggested in other threads, I also tried quote="". The EOF warning disappeared, but still only 3514 lines are imported.
Any advice on how I can get read.table() to work for this particular txt file?
最满意答案
它看起来像你的数据实际上有11548行。 这工作:
read.table(url('http://weather.noaa.gov/data/nsd_bbsss.txt'), sep=';', quote=NULL, comment='', header=FALSE)编辑:根据@ MrFlick的评论如下更新。
It looks like your data actually has 11548 rows. This works:
read.table(url('http://weather.noaa.gov/data/nsd_bbsss.txt'), sep=';', quote=NULL, comment='', header=FALSE)edit: updated according @MrFlick's comment's below.
更多推荐
发布评论