Aan de slagGa gratis aan de slag

Stop being noisy!!!

The message() function is useful for giving users an indication of how their code is running.

The function simulate() performs a Monte-Carlo simulation, with the number of simulations specified by the runs argument. The function helpfully uses message() to indicate progress.

Deze oefening maakt deel uit van de cursus

Defensive R Programming

Cursus bekijken

Oefeninstructies

  • Call the simulate() function and suppress the output using suppressMessages(). Store the simulations in object call sim.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Suppress the standard output of the simulate() function
sim = ____(simulate(runs = 5))
Code bewerken en uitvoeren