s-news
[Top] [All Lists]

RE: Re: subsetting data frames

To: <s-news@lists.biostat.wustl.edu>
Subject: RE: Re: subsetting data frames
From: "Dr Stuart Leask" <stuart.leask@nottingham.ac.uk>
Date: Wed, 13 Dec 2000 16:08:54 -0000
Many thanks to Ursula, Jean, Jason, Matthew, Leonid, Robert, Nick and
Marcel.
The answer is, of course I'm missing a comma (to specify rows in the 2D
matrix represented by a dataframe):

> datasubset.df <- data.df[flag==1, ]

Many also suggested putting 'data.df$' in front of 'flag', in case 'flag'
hadn't been placed in the current environment (eg. by attach-ing data.df).

For me, however, the problem was the lack of comma.

Stuart

PS. These responses arrived just over a minute after I posted this. Perhaps
the server should gather some stats, and offer a trophy!

*************************************************************
Stuart Leask MA MRCPsych
Clinical Lecturer in Psychiatry
Duncan Macmillan House
Porchester Road               "Ask a clock how it works, &
Nottingham                    all it will tell you is the time"
UK   NG3 6AA
Tel: +44-0 115 969 1300 xtn 40784 Fax: 0115 955 5352
*************************************************************


<Prev in Thread] Current Thread [Next in Thread>