[R] Input to variables - help please
villandl at dms.umontreal.ca
Wed May 13 22:10:28 CEST 2009
Steve Sidney wrote:
> Dear list
> I have managed to write a short program to evaluate data which is
> from a csv file using the following
> x = read.csv("wms_results.csv", header=TRUE)
> All works fine but since I have a number of similar data files which have
> different names, I would like the program to allow me to input the file
> name, rather than having to edit the program.
>> From the documentation I am unclear how to replace the "filename.csv"
>> with a
> string varaiable so that from the keyboard I can input the name.
> Also which command can I use to output some text to the monitor as a
> Any help would be great and apologies for such a simple question. Thanks
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
I suspect the choose.files() function could be useful in this setting.
Also, I've read on this forum that message() or cat() were commonly used
for a prompt (all taken from Prof. Brian Ripley's reply to "Prompt comes
Hope this helps,
McGill University Health Center -
Montreal Children's Hospital Research Institute/
More information about the R-help