Please tell me how to access the contents of the object.
Specifically...
sex<-c("F", "M", "M", "M", "F")
number<-c (1, 2, 3, 4, 5)
x<-data.frame (SEX=sex, NUMBER=number)
y<-c (1, 2, 4)
At times like this...
c<-subset(x,NUMBER!=y)
I want to do it like above, but it doesn't work
In other words, I would like to leave only 3,5 of NUMBER in the end.
It's hard to understand how to ask questions, but I appreciate your cooperation.
r
>x [!(x$NUMBER%in%y),]
SEX NUMBER
3M3
5F5
That's right. The %in% operator matches multiple conditions.
© 2024 OneMinuteCode. All rights reserved.