Skip to content

Deleting rows based on identity variable

3 messages · gina patel, Nordlund, Dan (DSHS/RDA), Baptiste Auguie

#
The problem is rules of precedence for evaluation.  Try

d2<-d1[!(id %in% c(1,4)), ]

Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA  98504-5204
#
just for curiosity,

`%ni%` <- Negate(`%in%`)
 >  1 %ni% c(2,1)
[1] FALSE

d1[id %ni% c(1,4), ]

baptiste
On 2 Apr 2009, at 22:17, gina patel wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag