do we need to have a function in Run.monty.hall file
because when I do function() {
if ( args == keep) .... it doesn't work but when I do if right away it work
is that a problem in my utilities file?
Also when I am trying to put in the conditions for else if it acts as if I did else only so it just does car( error message) whatever the argument is
Do you have a variable defined called 'keep'? I suspect not. Is it a variable called 'keep' you want to be comparing the argument to, or something else (though similar)?
I don't have a variable called keep I am using this if (args[1] == "Keep")
play.monty.halls(100,FALSE)
I tried to make a vector that has c("Keep", "Switch") but it does the same thing works for keep and switch but then gives off the same error message I gave it for any other thing
play.monty.halls(100,FALSE)
I tried to make a vector that has c("Keep", "Switch") but it does the same thing works for keep and switch but then gives off the same error message I gave it for any other thing
Without seeing your code I can't say what the problem is.
Is that a copy and paste of your code? Because keep without quotation marks is referencing a variable. “Keep” with quotation marks references the word keep