Assignment 5 Part 2

Assignment 5 Part 2

by Jamal-Roderick Al-Refaee -
Number of replies: 1

Hello,

I am wondering how to check if the user input for "Run.Monty.Hall.R" is more than 1, as required in Part 2 of Assignment 5

  • "If the number of command-line arguments is not 1 the script should exit with an error message."

I tried using help(readline), and in the description it states that "readline" returns a vector of length 1, and removes all trailing and leading spaces. 

Thanks,

Jamal 


In reply to Jamal-Roderick Al-Refaee

Re: Assignment 5 Part 2

by Erik Spence -
You should be using commandArgs(trainingOnly = TRUE), not readline.