Skip to content
Prev 267081 / 398502 Next

[solved] scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?

Am Freitag, den 29.07.2011, 15:28 +0200 schrieb Paul Menzel:
[?]
Searching for ?source code? in the R Wiki, I found the Wiki page
scriptingr [3] ? which did not turn up in my other searches. As it
turned out you can encode `"` by `\"` in Bash too. So the following
works just fine.

        $ for i in $(seq 2); do r -e "source(\"/tmp/iterf.r\"); print(f$i(2, 3)) )" ; done
        [1] 5
        [1] 10


Thanks,

Paul
[3] http://rwiki.sciviews.org/doku.php?id=tips:scriptingr
-------------- 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/20110730/6087b480/attachment.bin>