[R] [solved] littler: Use for batch processing of data sets: How to pass filename?

Paul Menzel paulepanter at users.sourceforge.net
Mon Dec 12 17:22:11 CET 2011

Am Montag, den 12.12.2011, 09:41 -0500 schrieb R. Michael Weylandt :
> Why can't you just replace "temp/data" with filename (no quotes)? I'm not sure I get the question...

… no I am feeling silly and I do not know where I screwed up before.
Here is the full working example.

        #!/usr/bin/env r
        if (is.null(argv) | length(argv)!=1) {
          cat("Usage: auswertung.r datafile \n")
        filename <- as.character(argv[1])
        d = data.frame(x=scan(filename))
        write(sum(d$x), paste(filename, ".result", sep=""), ncolumns=1)

Thank you very much,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111212/73f5d345/attachment.bin>

More information about the R-help mailing list