j1n3l0 has asked for the wisdom of the Perl Monks concerning the following question:
So how can I do this in R? The documentation says to use args <- commandArgs(TRUE) but does not really say more than that. What I've got so far is something like this:#!/usr/bin/perl -w use strict; use Data::Dumper; my $x = shift; # ... then i can play with $x here my @xvalues = (1 .. $x); my @yvalues = map { $_ ** 2 } @xvalues; print Dumper \@xvalues, \@yvalues; exit (0);
Any help is much appreciated =)#args <- commandArgs(TRUE) # This works okay but I would like to replace 10 as a parameter though x <- c(1:10) y <- c(x^2) png(filename="plot.png", bg="transparent") plot(x, y) dev.off()
|
|---|