Good day everyone, I am new in R programming (my question may sound trivial to you): is there any way to ask the user to enter a string within an R process, say a filename, make R to recognise it and open the given file? It is a simple exercise in other languages. I am using R2.1.1 in a LINUX machine. Thanks for your help. Augusto -------------------------------------------- Augusto Sanabria. MSc, PhD. Mathematical Modeller Risk Research Group Geospatial & Earth Monitoring Division Geoscience Australia (www.ga.gov.au) Cnr. Jerrabomberra Av. & Hindmarsh Dr. Symonston ACT 2609 Ph. (02) 6249-9155
On Jan 10, 2006, at 4:34 PM, <Augusto.Sanabria at ga.gov.au> <Augusto.Sanabria at ga.gov.au> wrote:> I am new in R programming (my question may sound trivial to you): > is there any way to ask the user to enter a string within an R > process, say a filename, make R to recognise it and open the given > file?Sure, for reading you can use readLines. I have no idea what you mean by "recognise", but let's say if you wanted to use read.table, it would be read.table(readLines(n=1)) Of course, in R there is an even more convenient method far that ;) read.table(file.choose()) Cheers, Simon