On Sat, 17 Nov 2007 15:47:42 -0600, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote:
[...] > You're almost there -- just use 'as.numeric' on ss too: > [EMAIL PROTECTED]:~> cat /tmp/seb.r #!/usr/bin/env r > ff <- as.numeric(argv[1]) > ss <- as.numeric(argv[2]) > print(ff * ss) > [EMAIL PROTECTED]:~> /tmp/seb.r 2 3 > [1] 6 > [EMAIL PROTECTED]:~> Thanks Dirk! However, I'm trying to pass several numbers as a single argument, which should be turned into a numeric vector, and doing as.numeric() fails: $ r littler_ex.R 14 '3, 2' [1] NA ,-----[ cat ~/scripts/R/littler_ex.R ] | ff <- as.numeric(argv[1]) | ss <- as.numeric(argv[2]) | print(ff * ss) `----- I know I could simply pass each number as a separate arg, but I already have 6 args to handle. I didn't find an example for this situation in the examples. Thanks. -- Seb _______________________________________________ R-SIG-Debian mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-debian

