tdsmith / aRrgh

A newcomer's (angry) guide to data types in R
Other
306 stars 14 forks source link

<<- assigns to closest parent environment symbol #12

Closed kevinushey closed 8 years ago

kevinushey commented 10 years ago

E.g.

x <- 1

f <- function() {
  x <- 3
  g <- function() {
    x <<- 2
    return(NULL)
  }
  g()
  return(x)
}

print( c(f(), x) ) ## [1] 2 1
tdsmith commented 10 years ago

I'm kinda thinking there should be a section on namespaces and name resolution where this would fit nicely? I don't understand it yet though so I don't know when that's going to happen!

tdsmith commented 10 years ago

Also, Google offered to translate the text of the Github auto-email from Lithuanian. R!

kevinushey commented 10 years ago

This is an exceptionally good post breaking all of that down: http://obeautifulcode.com/R/How-R-Searches-And-Finds-Stuff/ - it shares the similarly frustrated-with-R tone as well :)

tdsmith commented 8 years ago

Oh I fixed this in 87c5b7baa2e7c565b9e6fbeedd7b71d9dc973ad8 I think!

tdsmith commented 8 years ago

Added that link in 381bec0