CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Defensive R Programming

Afficher le cours

Instructions

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

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Suppress the standard output of the simulate() function
sim = ____(simulate(runs = 5))
Modifier et exécuter le code