[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

[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.

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

2008-11-14 Thread Chang Jia-Ming
, 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 file like the following example. plot_test - function(f1,f2) { plot_file(f1); plot_file(f2); } However, the above function

[R] How to reuse my self function?

2009-03-04 Thread Chang Jia-Ming
Dear all, I wrote a function test1 in test1.R. Right, I am writing another function test2 on test2.R and trying to use test1 function. How can I do? Is there any similar way like including test1.R in test2.R file? Thank You Very Much. Jia-Ming 張家銘

Re: [R] How to reuse my self function?

2009-03-04 Thread Chang Jia-Ming
the arguments for test1 functions should be consider to be also arguments of test2 function. test2 - function( test1arguments, test2arguments ){ ... value - test1( test1arguments ) ... } Regards 2009/3/4 Chang Jia-Ming chang.jiam...@crg.es Dear all, I wrote a function test1

[R] How to calculate the distance between two density functions

2008-12-05 Thread Chang Jia-Ming
Dear all, I wrote the following code to calculate the density functions for two data sets, respectively. den_str -density(str_data$Similarity); den_non_str -density(nonstr_data$Similarity); However, I would like to knowing the difference between den_str and den_non_str, that is, the