On 9 August 2010 19:30, Evgenia <[email protected]> wrote:
>
> Function ex works fine BUT I don't want the file of results to have the name
> "data Example" but
> "exampledata_9810 Example"
> How can I do this?

Do you mean that you want the filename to be based on the name of the
object passed to the function ?  If so, try this...

ex<-function(data) {
  sink(paste(deparse(substitute(data)), ' Example.txt'))
  print(summary(data))
}

Michael

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

Reply via email to