Re: [R] the number of the arguments of function is not sure

2008-11-14 Thread Chang Jia-Ming
Dear David & Philipp, It works well through adding "list(...)." Many Thanks. Jia Ming On Fri, Nov 14, 2008 at 5:55 PM, David Hajage <[EMAIL PROTECTED]> wrote: > You could try something like this : > > plot_test <- function(...) { > args <- list(...) > par(mfrow = c(length(args), 1)) > l

Re: [R] the number of the arguments of function is not sure

2008-11-14 Thread Philipp Pagel
On Fri, Nov 14, 2008 at 05:05:32PM +0100, Chang Jia-Ming wrote: > I want to write a function to plot a picture for each inputting file like > the following example. > plot_test <- function(f1,f2) > { > plot_file(f1); > plot_file(f2); > } > > However, the above function just could plot two inpu

Re: [R] the number of the arguments of function is not sure

2008-11-14 Thread David Hajage
You could try something like this : plot_test <- function(...) { args <- list(...) par(mfrow = c(length(args), 1)) lapply(args, plot) } plot_test(1:5) plot_test(1:5, 5:1, 3:7) 2008/11/14 Chang Jia-Ming <[EMAIL PROTECTED]> > I want to write a function to plot a picture for each inputting fi

[R] the number of the arguments of function is not sure

2008-11-14 Thread Chang Jia-Ming
I want to write a function to plot a picture for each inputting file like the following example. plot_test <- function(f1,f2) { plot_file(f1); plot_file(f2); } However, the above function just could plot two input file. If the number of input file is not sure, it could be 2, 3 or more. plot_te

[R] the number of the arguments of function is not sure

2008-11-14 Thread Chang Jia-Ming
I want to write a function to plot a picture for each inputting file like the following example. plot_test <- function(f1,f2) { } However, -- Jia-Ming 張家銘 Jia-Ming Chang PhD Student Comparative Bioinformatics Group Bioinformatics and Genomics Programme