Hi, is there advice how to subset a data.frame, where until R version 1.7.0 it was possible to write > data[["subset"]] which meant the same as > data$subset (data is a data.frame). From 1.7.1 on this does not seem to work longer. Could there be a bug in downwards compatibility? sincerely yours Dirk
Dirk Repsilber wrote:> Hi, > > is there advice how to subset a data.frame, where until R version 1.7.0 > it was possible to write > > > data[["subset"]] > > which meant the same as > > > data$subset > > (data is a data.frame). From 1.7.1 on this does not seem to work longer. > Could there be a bug in downwards compatibility? > > sincerely yoursWorks for me. Are you sure the object "data" is a data.frame in your case? Uwe Ligges
Still works for me in both 1.7.1 and 1.8.0 (in development)> data(women) > women[["height"]][1] 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72> women$height[1] 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 Can you provide an example of how it is failing for you? Dirk Repsilber <dirk.repsilber at gmx.de> writes:> Hi, > > is there advice how to subset a data.frame, where until R version > 1.7.0 it was possible to write > > > > data[["subset"]] > > which meant the same as > > > data$subset > > (data is a data.frame). From 1.7.1 on this does not seem to work > longer. Could there be a bug in downwards compatibility? > > > sincerely yours > > Dirk > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help-- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/
On Thu, 24 Jul 2003 16:27:28 +0200, Dirk Repsilber <dirk.repsilber at gmx.de> wrote :>Hi, > >is there advice how to subset a data.frame, where until R version 1.7.0 >it was possible to write > > > data[["subset"]] > >which meant the same as > > > data$subset > >(data is a data.frame). From 1.7.1 on this does not seem to work longer. >Could there be a bug in downwards compatibility?What are you trying to achieve? The notation you give still works if "subset" is one of the column names; I don't think it ever worked if "subset" was a logical vector, like its name would suggest. Duncan Murdoch