[R] read.table truncated data?

Sarah Goslee sarah.goslee at gmail.com
Wed Aug 24 20:34:33 CEST 2011


Hi,

On Wed, Aug 24, 2011 at 2:18 PM, zhenjiang xu <zhenjiang.xu at gmail.com> wrote:
> Hi R users,
>
> I was using read.table to read a file. The data.fame looked alright, but I
> found not all rows are read by the read.table. What's wrong with it? It
> didn't give me any warning or error messages. Why the data are truncated?
> Thanks.
>
> $ wc -l all/isoform_exp.diff
> 42847 all/isoform_exp.diff
>
>> a=read.table('all/isoform_exp.diff', header=T, sep='\t')
>> nrow(a)
> [1] 21423

This is a common problem. You need to take a look at the last row that
was imported, and the rows around 21423 in the original file.

Common causes include stray single or double quotation marks, and
other special characters in your file like the default comment.char #

Sarah
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list