Re: [R] Write.table query

From: Henric Nilsson <henric.nilsson_at_statisticon.se>
Date: Wed 16 Mar 2005 - 17:52:31 EST

On On, 2005-03-16, 05:43, Jones, Glen R skrev:

> Hello,
>
> I have the following 'write.table' statement which works fine
>
> write.table(DataOutput,"c:/Prices.csv",append = TRUE,col.names = NA,sep
> = "," )
>
> My query is, how could I modify this so I can include a variable name as
> a prefix before the 'Prices.CSV' filename.
>
> For example:
>
> prefixname = "DevX"
>
> write.table(DataOutput,"c:/" &prefixname& "Prices.csv",append =
> TRUE,col.names = NA,sep = "," )
>
> With the resultant CSV output to be named "DevXPrices.csv".

Use `paste':

> prefixname <- "DevX"
> paste("c:/", prefixname, "Prices.csv", sep = "")
[1] "c:/DevXPrices.csv"

HTH,
Henric



R-help@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 Received on Wed Mar 16 18:00:29 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:48 EST