Get startedGet started for free

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.

This exercise is part of the course

Defensive R Programming

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Suppress the standard output of the simulate() function
sim = ____(simulate(runs = 5))
Edit and Run Code