Re: [R] Subset and logical operator error

From: Ken Knoblauch <knoblauch_at_lyon.inserm.fr>
Date: Tue, 12 Jun 2007 21:18:23 +0000 (UTC)

SĂ©bastien <pomchip <at> free.fr> writes:

>
> Can you please point to me my syntax mistake or indicate a method to get
> this type of data.frame subset ?
>
> Thank you in advance
>
> ID value
> 1 1 1.2
> 2 2 1.2
> 3 3 1.2
> 4 4 1.2
> 5 5 A
> 6 6 A
> 7 7 A
> 8 8 A
> subset(mdat,value!"A")
>
> Error: syntax error, unexpected '!', expecting ',' in "subset(mdat,value!"
>
Looks like you forgot the "=" as in

subset(mdat, value != "A")
  ID value

1  1   1.2
2  2   1.2
3  3   1.2
4  4   1.2

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 12 Jun 2007 - 21:33:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Jun 2007 - 22:31:52 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.