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
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:
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:
???
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.
Hi there, this is a very easy question, i just cant seem to find a straight
answer- i need this one thing, then i can finish my project for this term.
I am making an interactive application with R where I get the user to input
numbers that the program then uses in the analysis. I have figured
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