Can you access variables from inside functions?
Suppose you ran this code in a fresh R session.
x_plus_y <- function(x) {
x + y
}
y <- 7
x_plus_y(5)
Deze oefening maakt deel uit van de cursus
Introduction to Writing Functions in R
Praktische interactieve oefening
Zet theorie om in actie met een van onze interactieve oefeningen.
Begin met trainen