I read a data set into a data.frame. I then operate on the set, add columns to the frame etc. and now want to output the frame into a file. Trouble is, I want the file to have a name based upon the original data set name. I cannot figure out how to cat strings together and use that new string as the output filename... Example: original data name: D08a desired output name: Analyzed_D08a Any ideas? Marko -- Mark O. Kimball Gasparinilab, University at Buffalo | Low temp physics mok2 at physics.buffalo.edu | URL: enthalpy.physics.buffalo.edu lab phone: 716-645-2017x122 Fax: 716-645-2507
On Thu, 1 Apr 2004, Mark O. Kimball wrote:> I read a data set into a data.frame. I then operate on the set, add > columns to the frame etc. and now want to output the frame into a file. > Trouble is, I want the file to have a name based upon the original data > set name. > > I cannot figure out how to cat strings together and use that new string > as the output filename... > > Example: > original data name: D08a > desired output name: Analyzed_D08apaste("Analysed",oldname,sep="_") This is mentioned on the help page for cat(), precisely to help Unix-influenced people who think that `cat' is a natural abbreviation for `concatenate' -thomas
On Thursday 01 April 2004 01:40 pm, Mark O. Kimball wrote:> I read a data set into a data.frame. I then operate on the set, add > columns to the frame etc. and now want to output the frame into a file. > Trouble is, I want the file to have a name based upon the original data > set name. > > I cannot figure out how to cat strings together and use that new string > as the output filename... > > Example: > original data name: D08a > desired output name: Analyzed_D08a >Thanks to all who replied. Indeed, the paste() command what exactly what I needed... Marko -- Mark O. Kimball Gasparinilab, University at Buffalo | Low temp physics mok2 at physics.buffalo.edu | URL: enthalpy.physics.buffalo.edu lab phone: 716-645-2017x122 Fax: 716-645-2507