From simon.urbanek at r-project.org  Tue Jan 10 22:43:21 2006
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 10 Jan 2006 16:43:21 -0500
Subject: [Rd] Interfacing with user in R
In-Reply-To: <9707EBA615A57747A0668CECD4638A3081E2EF@mail.agso.gov.au>
References: <9707EBA615A57747A0668CECD4638A3081E2EF@mail.agso.gov.au>
Message-ID: <1689A0EA-C51D-48E5-BE0F-E32863244077@r-project.org>

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



[Rd] Interfacing with user in R
Simon Urbanek