LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Defensive R Programming

Kurs anzeigen

Anleitung zur Übung

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

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Suppress the standard output of the simulate() function
sim = ____(simulate(runs = 5))
Code bearbeiten und ausführen