RosettaCodeData/Task/Scope-modifiers/R/scope-modifiers-1.r

8 lines
170 B
R

X <- "global x"
f <- function() {
x <- "local x"
print(x) #"local x"
}
f() #prints "local x"
print(x) #prints "global x"