JLucke at ria.buffalo.edu
2009-Feb-13 15:20 UTC
[R] Distinguishing variables from functions with the same name
guRus: I have a variable "beta" as an argument to R's beta function. So essentially I have a case of beta(alpha, beta). What surprises me is that R doesn't barf on this stupid programming practice. R gets the right answer. How does R know "beta the variable" from "beta the function"? Joseph F. Lucke Senior Statistician Research Institute on Addictions University at Buffalo SUNY [[alternative HTML version deleted]]
Gabor Grothendieck
2009-Feb-13 15:47 UTC
[R] Distinguishing variables from functions with the same name
See ?get and try: sin <- 1 get("sin", mode = "numeric") get("sin", mode = "function") On Fri, Feb 13, 2009 at 10:20 AM, <JLucke at ria.buffalo.edu> wrote:> guRus: > > I have a variable "beta" as an argument to R's beta function. So > essentially I have a case of beta(alpha, beta). What surprises me is that > R doesn't barf on this stupid programming practice. R gets the right > answer. How does R know "beta the variable" from "beta the function"? > > Joseph F. Lucke > Senior Statistician > Research Institute on Addictions > University at Buffalo > SUNY > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >