ComeçarComece de graça

Your first function: tossing a coin

Time to write your first function! It's a really good idea when writing functions to start simple. You can always make a function more complicated later if it's really necessary, so let's not worry about arguments for now.

Este exercício faz parte do curso

Introduction to Writing Functions in R

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

coin_sides <- c("head", "tail")

# Sample from coin_sides once
___
Editar e executar o código