Re: [R] difference in behavior between batch and source

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun 04 Jun 2006 - 10:15:04 EST

Maybe:

nm <- c("a", "b", "c")
nm <- c(nm, "d", "e", "f")
...
read.table("myfile.dat", col.names = nm)

or paste the column names into the first line of the data file using a text editor and use:

read.table("myfile.dat", header = TRUE)

On 6/3/06, markleeds@verizon.net <markleeds@verizon.net> wrote:
> Hi : I am using R 2.20 on windows XP and I have a REALLY
> long read.table statement because the col.names argument
> has 440 character strings in it. ( I use python to write R code ).
> When I run the read.table statement inside an R program
> ( the R program only consists of the read.table statement )
> using the source command in an interactive R session,
> everything works fine. But, if I take the same program
> and try to run it using R CMD BATCH program name ,
> the .Rout file shows me that the execution gets halted at
> one of the col.names arguments but there is no error message.
> it just says "execution halted".
>
> So, I am thinking that this may have to do with some limit
> in R for how long the col.names argument can be ( or
> any command for that matter ) ? But, the same program works using the source command and I would think that the source command
> still has to read theline in somewhere ?
>
> What makes me think even more that the problem has something to
> do with the length of the command is that, as a test,
> I took the tread.table command and copied and pasted it into
> an interactive session to see if it would run that way.
> What was interesting was that the whole command did not get pasted and the pasting stopped at exactly the same place that the .Rout file showed that it stopped during BATCH mode.
>
> I can't send the command right now because I don't have email at
> the location where I am working but I may be able
> to send it later ? Any thoughts, suggestions or solutions
> would be really appreciated because I need to be able
> to get this program to work using BATCH mode.
>
> Thanks a lot.
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
>
https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jun 04 10:32:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 04 Jun 2006 - 12:10:27 EST.

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