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
*************************************************************
|