On Fri, 17 Oct 2003, Backlund, Jan Erik (JE) wrote:
> I am confused by the following difference in the behavior of R and S. Any
> clarification would be greatly appreciated.
sw[[2,1]] in R is short for sw[[2]][[1]], which in the case of a data
frame is sw[1,2], as your example shows.
-thomas
> Jan Erik Backlund
> Dow AgroSciences, LLC.
> [EMAIL PROTECTED]
>
>
> R : Copyright 2003, The R Development Core Team
> Version 1.8.0 (2003-10-08)
> > sw
> Fertility Agriculture Examination Education Catholic
> Courtelary 80.2 17.0 15 12 9.96
> Delemont 83.1 45.1 6 9 84.84
> Franches-Mnt 92.5 39.7 5 5 93.40
> Moutier 85.8 36.5 12 7 33.77
> Neuveville 76.9 43.5 17 15 5.16
> > sw[2,1]
> [1] 83.1
> > sw[[2,1]]
> [1] 17
> >
>
> and the corresponding behaviour in S
> S-PLUS : Copyright (c) 1988, 2001 Insightful Corp.
> S : Copyright Lucent Technologies, Inc.
> Professional Edition Version 6.0.3 Release 2 for Microsoft Windows : 2001
> > sw
> Fertility Agriculture Examination Education Catholic
> Courtelary 80.2 17.0 15 12 9.96
> Delemont 83.1 45.1 6 9 84.84
> Franches-Mnt 92.5 39.7 5 5 93.40
> Moutier 85.8 36.5 12 7 33.77
> Neuveville 76.9 43.5 17 15 5.16
> > sw[2,1]
> [1] 83.1
> > sw[[2,1]]
> [1] 83.1
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
Thomas Lumley Assoc. Professor, Biostatistics
[EMAIL PROTECTED] University of Washington, Seattle
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help