Variable precedence 2
Consider this (slightly different) code, run in a fresh R session.
x_plus_y <- function(x) {
x <- 6
y <- 3
x + y
}
y <- 7
If you now call x_plus_y(5), what is the result?
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Introduction to Writing Functions in R
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำจริง
เปลี่ยนทฤษฎีให้เป็นการลงมือทำด้วยแบบฝึกหัดเชิงโต้ตอบหนึ่งในของเรา
เริ่มแบบฝึกหัด