Re: [R] Reading user input

2007-04-04 Thread jim holtman
That is exactly what the code does. On 4/3/07, projection83 [EMAIL PROTECTED] wrote: I dont know if thats what i want (its not working like i want). I would like to have R pause, wait for a user input of a number, then store that number as a variable to use in the next calculation it

Re: [R] Reading user input

2007-04-04 Thread Charilaos Skiadas
I think the problem the OP may be having is that the code will not work if you put it in a document window in R and then tell R to source the document. At least not with R.app in MacOSX. This is what happened when I did it: source(/tmp/Rtmp0TQfA6/file10d63af1) enter the number of groups:

Re: [R] Reading user input

2007-04-03 Thread projection83
I dont know if thats what i want (its not working like i want). I would like to have R pause, wait for a user input of a number, then store that number as a variable to use in the next calculation it does... Or should the below do that? jim holtman wrote: what you want is:

Re: [R] Reading user input

2007-04-03 Thread Petr Klasterecky
??? The code below is correct and does exactly what you described - just check the value of ANSWER. R is paused and the user-specified valued is assigned to ANSWER when you call your function, not inside. In your former code ANSWER was a local variable which 'died' when your function finished.

Re: [R] Reading user input

2007-04-01 Thread jim holtman
what you want is: defineSamples- function() { readline(enter the number of groups: ) } ANSWER - defineSamples() On 4/1/07, projection83 [EMAIL PROTECTED] wrote: Hi there, this is a very easy question, i just cant seem to find a straight answer- i need this one