[R] Confused with Student's sleep data description

Олег Девіняк o.devinyak at gmail.com
Fri Jan 27 12:03:55 CET 2012


I am confused whether Student's sleep data "show the effect of two
soporific drugs" or Control against Treatment (one drug). The reason
is the next:
> require(stats)
> data(sleep)
> attach(sleep)
> extra[group==1]
numeric(0)
> group
 [1] Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Trt Trt Trt Trt Trt Trt Trt Trt Trt
[20] Trt
Levels: Ctl Trt
> sleep$group
 [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2
Levels: 1 2

Does some package overwrite my attach()? I am worried mostly in the
right performance of my code by others. So have the attach() to be
avoided?
Thanks for answers!



More information about the R-help mailing list