Hi, 

I encountered a strange issue while reading in a data table from `txt` format. If I read it from `txt` by `read.table` it does not include all rows but if I convert to `csv` and read it with `read.csv` its perfect. Does someone know the issue or is it my code? 

[Here][1] is the file.

```r
test <- read.table("./Annotations/all_genes_pombase.txt",
+ header=T,
+ sep="\t",
+ row.names=1,
+ stringsAsFactors = F)
> dim(test)
[1] 4533    7
> str(test)
'data.frame':	4533 obs. of  7 variables:
 $ name        : chr  "SPAC1002.01" "pom34" "gls2" "taf11" ...
 $ chromosome  : chr  "I" "I" "I" "I" ...
 $ description : chr  "conserved fungal protein " "nucleoporin Pom34 " "glucosidase II alpha subunit Gls2 " "transcription factor TFIID complex subunit Taf11 (predicted) " ...
 $ feature_type: chr  "protein_coding" "protein_coding" "protein_coding" "protein_coding" ...
 $ strand      : int  1 1 -1 -1 -1 -1 -1 -1 -1 -1 ...
 $ start       : int  1798347 1799061 1799915 1803624 1804548 1807270 1807996 1809480 1811408 1813740 ...
 $ end         : int  1799015 1800053 1803141 1804491 1806797 1807781 1809433 1811361 1813805 1815796 ...
```

 [1]: https://drive.google.com/file/d/0Bxl0rZon0OuzR1VzN3cyMlhkUUk/view?usp=sharing
Use the argument `quote = ""` inside read.table.

    read.table("your_file", quote="", other.arguments)

**Explanation**:
Your data has a single quote on 59th line (`( pyridoxamine 5'-phosphate oxidase (predicted)`). Then there is another single quote, which complements the single quote on line 59, is on line 137 `(5'-hydroxyl-kinase activity...)`. Everything within quote will be read as a single field of data, and quotes can include the newline character also. That's why you lose the lines in between. **`quote = ""` disables quoting altogether**. 

There are other more instances where this 'quoting' happens again. One way to know how many fields read.table sees in every row is by using `count.fields`

    num.fields = count.fields("all_genes_pombase.txt", sep="\t")

Now look at the variable  `num.fields`, there will be a lot of NAs, the lines which are not read correctly by `read.table`

**The problem doesn't arise with read.csv** because the [quoting defaults][1] are different in read.table and read.csv, due to some reason really unknown to me!

    read.table: quote = "\"'"
    read.csv: quote = "\""

PS: The best way to avoid the reading file nuisance of *read.table* is to use *fread()* from data.table package. The side benefit is that it's blazing fast for large files and it guesses the field separator automatically. See my earlier post: https://www.biostars.org/p/221009/#221032


  [1]: http://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html