[R] object(s) are masked from package - what does it mean?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Oct 22 09:26:27 CEST 2006


"tom soyer" <tom.soyer at gmail.com> writes:

> Thanks Marc and Gregor for the detailed explanation. You are right, the
> masking is potentially dangerous. Since R is object oriented, I am surprised
> that this is an issue. Does this mean that encapsulation does not exist in
> R?

R does have namespaces, but you can't have your cake and eat it too:
If your attached data frame contains a variable "airquality", then you
can't both access that one and the same-named example dataset as just
"airquality" (datasets::airquality still works).

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list