checking scope resolution in R