Aan de slagGa gratis aan de slag

Function scope (2)

Let's try another one. Here, hundred is defined outside of the function scope, but is used inside of the function.

hundred <- 100

percent_to_decimal <- function(percent) {
    percent / hundred
}

What will percent_to_decimal(6) return?

Deze oefening maakt deel uit van de cursus

Intermediate R for Finance

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen