Re: [R] txt file, 14000+ rows, only last 8000 appear

From: jim holtman <jholtman_at_gmail.com>
Date: Mon, 09 Jun 2008 16:37:08 -0400

You also might use 'count.fields' to see how many values are on each line. Also do you have any comment charaters in the text? Here is a large file that is fine:

> # create a large file
> myFile <- tempfile()
> myConn <- file(myFile, 'w')
> for (i in 1:20000) writeLines("1 2 3 4 5 6", myConn)
> close(myConn)
> file.show(myFile)
> # now read it
> myConn <- file(myFile, 'r')
> x <- read.table(myConn)
> close(myConn)
> str(x)

'data.frame': 20000 obs. of 6 variables:

 $ V1: int  1 1 1 1 1 1 1 1 1 1 ...
 $ V2: int  2 2 2 2 2 2 2 2 2 2 ...
 $ V3: int  3 3 3 3 3 3 3 3 3 3 ...
 $ V4: int  4 4 4 4 4 4 4 4 4 4 ...
 $ V5: int  5 5 5 5 5 5 5 5 5 5 ...
 $ V6: int  6 6 6 6 6 6 6 6 6 6 ...

>

On Mon, Jun 9, 2008 at 4:25 PM, IAIN GALLAGHER < iaingallagher_at_btopenworld.com> wrote:

> I'm pretty sure I've had similar problems to this in the past and the
> problem has been a badly formatted text file ie you think it's all tab
> delimited but it's not.
>
> I can't be more specific (because it's your file) but it would be worth
> copying the non appearing rows into a separate file and see if you can track
> down the region of the file that's causing the problem.
>
> Cheers
>
> Iain
>
> RobertsLRRI <raymond.roberts_at_ncf.edu> wrote:
>
> You are asked to follow the posting guide and to provide "commented,
> minimal, self-contained, reproducible code".
>
> Code entered:
> Influenza<-read.delim("C://Documents and
> Settings//rroberts//desktop//H5N1//0v8a1n3.dat.txt")
>
> Influenza
>
> rows
> 6505
> ...
> 14421
>
>
> So the first 6504 rows aren't displayed
>
> Thank you
> --
> View this message in context:
> http://www.nabble.com/txt-file%2C-14000%2B-rows%2C-only-last-8000-appear-tp17701519p17735926.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 09 Jun 2008 - 20:45:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 09 Jun 2008 - 22:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive