ComeçarComece de graça

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)

Este exercício faz parte do curso

Introduction to Writing Functions in R

Ver curso

Exercício interativo prático

Transforme a teoria em ação com um de nossos exercícios interativos

Começar o exercício