[R] using an objects contents in a text string

josquint josquint at unimelb.edu.au
Wed Aug 25 13:35:21 CEST 2010


Hi,  I am (trying) to write a script that will execute a set of functions and
then to write some of the output data frames to file. I am wanting to be
able to just change a single object and have this them populate through the
functions etc. I have no trouble making this work when the function is
calling for an argument that meets this criteria

e.g.

input.variable.name <- "DDDHHD"

list <- function(x, input.variable = input.variable.name, ...)

where DDDHHD will be then used as the input.variable in the function BUT

I can not seem to get the text string used as part of the name of the output
file name in the write.data.frame function.

e.g.

write(x, file = input.variable.name "_data.txt",      ...)

to create an output file with the name DDDHHD_data.txt

I know this syntax is incorrect but could someone guide me as to how to
acieve this (I hope it is clear??).....

Thanks in advance.


-- 
View this message in context: http://r.789695.n4.nabble.com/using-an-objects-contents-in-a-text-string-tp2338061p2338061.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list