[R] paste argument of a function as a file name

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Nov 10 15:11:45 CET 2005


Luis Ridao Cruz wrote:

> R-help,
> 
> I have a function which is exporting the output to a file via
> write.table(df, file =  "file name.xls" )
> 
> What I want is to paste the file name (above) by taking the argument to
> the function as a file name 
> 
> something like this:
> 
> MY.function<- function(df)
> {
> ...
> ...
> write.table(df,"argument.xls")
> }
> MY.function(argument)

Has been asked hundreds of times on this list. Please check the archives 
as the posting guide asks to do  ...

Hint: paste()

Uwe Ligges


> 
> Thank you
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list