simple<-function() {

if(exists("height"))

cat("height exists\n")

else

cat("height does not exist\n")

}

 

foo<-function() {

height<-10  

simple()

}

 

> foo()

height does not exist

 

Can somebody please explain why "simple" does not find the "height" variable
when I run it?

 

Is there an easy way to make R use scoping rules like python where it
searches over all frames to find the value of an symbol?

 

Thanks, Steve Eick

 


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to