Re: [R] scripts with littler

From: John Lawrence Aspden <news_at_aspden.com>
Date: Mon 08 Jan 2007 - 14:54:12 GMT

Thanks, that's a really neat mechanism, ( I especially like the note to vim, which will save all my scripts having to end .R )

Is there any way to get at the command line and stdio though?

With littler I can do things like:

#!/usr/bin/env r

print(argv)
t=read.table(file=stdin())

so that I can write unix-style filters.

Cheers, John.

Fran├žois Pinard wrote:

> I usually do something like:
>
>
> #!/bin/sh
> R --slave --vanilla <<EOF
>
> R script goes here...
>
> EOF
>
> # vim: ft=r
>
>
> If you need to search special places for packages, you may tweak
> exported environment variables between the first and second line.

-- 
Contractor in Cambridge UK -- http://www.aspden.com

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Jan 09 17:52:12 2007

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 Tue 09 Jan 2007 - 07:30:31 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.