Re: [R] wrong name of input file and goto like function

2011-07-25 Thread MacQueen, Don
While you study the documentation as others suggested, may I suggest that you take a look at the file.exists() function. Here is an example of using file.exists(). tmpfile <- define() if (file.exists(tmpfile)) { ## read the file } else { ## tell the user to try again } On Jul 24, 2011, at

Re: [R] wrong name of input file and goto like function

2011-07-24 Thread Uwe Ligges
stop even if user writes wrong name of input file? Thanking you, Warm Regards Vikas Bansal Msc Bioinformatics Kings College London From: Bert Gunter [gunter.ber...@gene.com] Sent: Sunday, July 24, 2011 3:58 PM To: Bansal, Vikas Cc: r-help@r-project.org Subje

Re: [R] wrong name of input file and goto like function

2011-07-24 Thread Bansal, Vikas
rg Subject: Re: [R] wrong name of input file and goto like function These are elementary programming constructs. I would suggest you take a look at an online basic (as in elementary, not the Basic language) programming tutorial to see how to do this sort of thing. R does it like many other language

Re: [R] wrong name of input file and goto like function

2011-07-24 Thread Bert Gunter
These are elementary programming constructs. I would suggest you take a look at an online basic (as in elementary, not the Basic language) programming tutorial to see how to do this sort of thing. R does it like many other languages (with ?for, ?while, ?if, etc.). -- Bert On Sun, Jul 24, 2011 at

[R] wrong name of input file and goto like function

2011-07-24 Thread Bansal, Vikas
Dear all, I have a question and need your help please. I have the following code which is asking user to enter the name of their file. define<- function() { readline("enter the name of your file: ") } df=read.table(define(),fill=T,sep="\t",colClasses = "character") Now I want if user wil