Hi,
I need to scan some files, and then do a boxplot graph of them. I also save
the output from the boxplot function, so I can process the data later.
For example, I need to scan 2 (it can be x, 0<x) files here.
A<-scan(F1)/100;
B<-scan(F2)/100;
Now let's try graph it. N1 is the label for F1, and so on.
bitmap(file=Name, type="png16m")
STATS<-boxplot(A,B,c(A,B),col="red", main="MyMain", names=c(N1, N2, "All"),
xlab="Hardware", ylab="milliseconds")
dev.off();
The problem is I don't really know what I will have at runtime. For example, I
may have to scan 3 or 4 files at runtime. Then, I will have to pass different
arguments to boxplot, like
STATS<-boxplot(A,B,C,c(A,B,C),col="red", main="MyMain", names=c(N1, N2, N3,
"All"), xlab="Hardware", ylab="milliseconds")
The function should look like:
process<-function(Name, F1, F2...N1,N2...)
How should I write a function that is flexible enough to handle this situation?
Thank you in advance.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.