How Mara mentioned it's not a very natural idiom in R, but if you are interested in environment access or creation etc. it's may a good point to start... 
x=1
y <- function(){
x <- x + 2
z = x
assign("x", z, envir = .GlobalEnv)
return(z)
}
x
#> [1] 1
y()
#> [1] 3
x
#> [1] 3
y()
#> [1] 5
x
#> [1] 5
y2 <- function(x) {
inner_y <- function(x) assign("Global.res", x^2, envir = .GlobalEnv)
inner_y(x+1)
}
y2(2)
Global.res
#> [1] 9
y2(3)
Global.res
#> [1] 16
Created on 2019-03-20 by the reprex package (v0.2.1)
Best regards
Adam