[R] doing many commands within R

Tim F Liao tfliao at uiuc.edu
Mon Jan 10 16:16:37 CET 2005


Sounds like you've got a file referencing problem.  You may
want to try and input the file into R using a simple
read.table command or something similar without yet running
your long script to see if your file can be called up.

Tim

---- Original message ----
>Date: Mon, 10 Jan 2005 13:55:28 +0100 (CET)
>From: Cserháti Mátyás <cs_matyi at freemail.hu>  
>Subject: [R] doing many commands within R  
>To: r-help at stat.math.ethz.ch
>
>
>
>Dear all,
>
>I'm new to this list, so let me greet everyone.
>
>My problem is that I have several thousand data files which I
want to 
>perform a lot of R commands on, which are found in a seperate
.R script.
>
>Now, what I did was within the R prompt, I used to read in a
list of the 
>data files. 
>
>e.g. 
>
>namelist <- readLines("list_of_names",n=-1)
>for (i in 1:100) {
>k <- function(namelist[i])
>write(k,file="outputfile",append=TRUE)
>}
>
>Next, I tried automating the R commands by making a loop.
Within the 
>loop I called the R-script. Within ecery single loop R called
the R-script 
>and performs the commands therein (or is supposed to perform
it) on 
>the actual data file.
>
>After a loop finished, I tried appending the output to an
output file.
>
>The problem is that R gives an error message saying that it
cannot 
>open the input files.
>
>What can I do?
>
>Thanks, Matthew
>
>______________________________________________
>R-help at 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




More information about the R-help mailing list