[R] newbie questions: attached data.frames and rm()

Alojz Loui Polic lpolic at ineural.com
Fri Mar 23 19:20:22 CET 2001


Hi

I'm just starting with R-plus and I have noticed
the following behaviour.

If a data.frame is attached and then removed before 
being detached, the data is still present in the 
path and can accessed. Is this expected behaviour, 
and if so why? 

Thank you 

Loui

below is sample code to show this, I'm using R-1.2.2
on Win-NT4


AA <- c(1, 1, 1, 1, 1)
BB <- c(2, 3, 2, 1, 2)
data1 <- data.frame( AA.data=AA, BB.data=BB )
ls()
attach(data1)
ls(2)

rm(data1)
ls()
ls(2)
AA.data[1]
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list