match() question or needle haystack problem for a data.frame

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

match() question or needle haystack problem for a data.frame

Knut Krueger-8

Hi to all

I would like to reduce the "Mydata" to rows, only if Mydata$Data1 are in
needles



needles =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15195,
15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 15204, 15205,
15206, 15207, 15208, 15209, 17615, 17616, 17617, 17618, 17619, 17620,
17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630,
17631, 17679, 17680, 17681, 17682, 17683, 17823, 17824, 17825, 17826,
17827, 17828, 17829, 17830, 17831, 17862, 17863, 17864, 17865, 17866,
17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876,
17877, 17878, 17879, 17880, 17881, 17882, 17883, 19255, 19256, 19257,
19258, 21289, 21290, 21291, 21292, 22890, 22891, 22892, 22893, 22894,
22895, 22896, 22897, 22898, 22899, 22900, 22901, 22902, 40428, 40429,
40430, 40431, 40432, 40433, 40434, 40435, 40436, 40437)

Haystack =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15187,
15188, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203,
15204, 15205, 15206, 15207, 15208, 15209, 16717, 16718, 17615, 17616,
17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626,
17627, 17628, 17629, 17630, 17631, 17679, 17680, 17681, 17682, 17683,
17817, 17818, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830,
17831, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870,
17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880,
17881, 17882, 17883, 17886, 19255, 19256, 19257, 19258, 21289, 21290,
21291, 21292, 22890, 22891, 22892, 22893, 22894, 22895, 22896, 22897,
22898, 22899, 22900, 22901, 22902, 40428, 40429, 40430, 40431, 40432,
40433, 40434, 40435, 40436, 40437, 40710, 40711, 49127, 49128, 52768)

Mydata =data.frame (DATA1=Haystack, Data2=c(1:length(Haystack)))



match(Mydata$DATA1, needles, nomatch=NA) does find all data which are in
needle - the others are set to the nomatch value.

But I don not find out how to reduce the data.frame  -  maybe match() is
not helpful for that.

Kind regards Knut

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: match() question or needle haystack problem for a data.frame

Bert Gunter-2
Re-read ?match and note the examples for %in%

-- Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Oct 22, 2018 at 7:38 AM Knut Krueger <[hidden email]>
wrote:

>
> Hi to all
>
> I would like to reduce the "Mydata" to rows, only if Mydata$Data1 are in
> needles
>
>
>
> needles =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
> 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15195,
> 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 15204, 15205,
> 15206, 15207, 15208, 15209, 17615, 17616, 17617, 17618, 17619, 17620,
> 17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630,
> 17631, 17679, 17680, 17681, 17682, 17683, 17823, 17824, 17825, 17826,
> 17827, 17828, 17829, 17830, 17831, 17862, 17863, 17864, 17865, 17866,
> 17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876,
> 17877, 17878, 17879, 17880, 17881, 17882, 17883, 19255, 19256, 19257,
> 19258, 21289, 21290, 21291, 21292, 22890, 22891, 22892, 22893, 22894,
> 22895, 22896, 22897, 22898, 22899, 22900, 22901, 22902, 40428, 40429,
> 40430, 40431, 40432, 40433, 40434, 40435, 40436, 40437)
>
> Haystack =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
> 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15187,
> 15188, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203,
> 15204, 15205, 15206, 15207, 15208, 15209, 16717, 16718, 17615, 17616,
> 17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626,
> 17627, 17628, 17629, 17630, 17631, 17679, 17680, 17681, 17682, 17683,
> 17817, 17818, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830,
> 17831, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870,
> 17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880,
> 17881, 17882, 17883, 17886, 19255, 19256, 19257, 19258, 21289, 21290,
> 21291, 21292, 22890, 22891, 22892, 22893, 22894, 22895, 22896, 22897,
> 22898, 22899, 22900, 22901, 22902, 40428, 40429, 40430, 40431, 40432,
> 40433, 40434, 40435, 40436, 40437, 40710, 40711, 49127, 49128, 52768)
>
> Mydata =data.frame (DATA1=Haystack, Data2=c(1:length(Haystack)))
>
>
>
> match(Mydata$DATA1, needles, nomatch=NA) does find all data which are in
> needle - the others are set to the nomatch value.
>
> But I don not find out how to reduce the data.frame  -  maybe match() is
> not helpful for that.
>
> Kind regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: match() question or needle haystack problem for a data.frame

Eric Berger
Hi Knut,
You are almost done.

> v <- match(Mydata$DATA1, needles, nomatch=NA)
> found <- Mydata[ !is.na(v), ]
> missing <- Mdata[ is.na(v), ]

HTH,
Eric


On Mon, Oct 22, 2018 at 5:51 PM Bert Gunter <[hidden email]> wrote:

> Re-read ?match and note the examples for %in%
>
> -- Bert
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Mon, Oct 22, 2018 at 7:38 AM Knut Krueger <[hidden email]>
> wrote:
>
> >
> > Hi to all
> >
> > I would like to reduce the "Mydata" to rows, only if Mydata$Data1 are in
> > needles
> >
> >
> >
> > needles =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
> > 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15195,
> > 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 15204, 15205,
> > 15206, 15207, 15208, 15209, 17615, 17616, 17617, 17618, 17619, 17620,
> > 17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630,
> > 17631, 17679, 17680, 17681, 17682, 17683, 17823, 17824, 17825, 17826,
> > 17827, 17828, 17829, 17830, 17831, 17862, 17863, 17864, 17865, 17866,
> > 17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876,
> > 17877, 17878, 17879, 17880, 17881, 17882, 17883, 19255, 19256, 19257,
> > 19258, 21289, 21290, 21291, 21292, 22890, 22891, 22892, 22893, 22894,
> > 22895, 22896, 22897, 22898, 22899, 22900, 22901, 22902, 40428, 40429,
> > 40430, 40431, 40432, 40433, 40434, 40435, 40436, 40437)
> >
> > Haystack =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431,
> > 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15187,
> > 15188, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203,
> > 15204, 15205, 15206, 15207, 15208, 15209, 16717, 16718, 17615, 17616,
> > 17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626,
> > 17627, 17628, 17629, 17630, 17631, 17679, 17680, 17681, 17682, 17683,
> > 17817, 17818, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830,
> > 17831, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870,
> > 17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880,
> > 17881, 17882, 17883, 17886, 19255, 19256, 19257, 19258, 21289, 21290,
> > 21291, 21292, 22890, 22891, 22892, 22893, 22894, 22895, 22896, 22897,
> > 22898, 22899, 22900, 22901, 22902, 40428, 40429, 40430, 40431, 40432,
> > 40433, 40434, 40435, 40436, 40437, 40710, 40711, 49127, 49128, 52768)
> >
> > Mydata =data.frame (DATA1=Haystack, Data2=c(1:length(Haystack)))
> >
> >
> >
> > match(Mydata$DATA1, needles, nomatch=NA) does find all data which are in
> > needle - the others are set to the nomatch value.
> >
> > But I don not find out how to reduce the data.frame  -  maybe match() is
> > not helpful for that.
> >
> > Kind regards Knut
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: match() question or needle haystack problem for a data.frame

Knut Krueger-8
Am 22.10.18 um 17:01 schrieb Eric Berger:
> v <- match(Mydata$DATA1, needles, nomatch=NA)
>  > found <- Mydata[ !is.na <http://is.na>(v), ]
>  > missing <- Mdata[ is.na <http://is.na>(v), ]

Thank you it is working, additionally as Bert suggested, it seems that

Mydata[Mydata$DATA1 %in% needles,]

is doing the same.

Kind Regards Knut

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: match() question or needle haystack problem for a data.frame

Bert Gunter-2
I suggest you spend a bit of time with an R tutorial or two and, in
particular learn about "logical indexing," as this basic R construct seems
to be mysterious to you.

Cheers,
Bert




On Mon, Oct 22, 2018 at 8:22 AM Knut Krueger <[hidden email]>
wrote:

> Am 22.10.18 um 17:01 schrieb Eric Berger:
> > v <- match(Mydata$DATA1, needles, nomatch=NA)
> >  > found <- Mydata[ !is.na <http://is.na>(v), ]
> >  > missing <- Mdata[ is.na <http://is.na>(v), ]
>
> Thank you it is working, additionally as Bert suggested, it seems that
>
> Mydata[Mydata$DATA1 %in% needles,]
>
> is doing the same.
>
> Kind Regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: match() question or needle haystack problem for a data.frame

Knut Krueger-8
Am 22.10.18 um 18:02 schrieb Bert Gunter:
> I suggest you spend a bit of time with an R tutorial or two and, in
> particular learn about "logical indexing," as this basic R construct
> seems to be mysterious to you.

Hi Bert,

especially the "match" help area is a little bit confusing.

And additional using a couple of programming languages with different
logical operators and different syntax is misleading me sometimes to the
wrong direction...

So the logic operations itself are not mysterious ;-)  but the
translation to R.
And thank's a lot to give me the keyword to find for what I am was
looking for: logical indexing.

I can not count the sites where I was looking to solve my problem ..
with the wrong keywords ... :-)

Kind Regards Knut

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

Knut Krueger-8
In reply to this post by Bert Gunter-2
Hi Bert,
another question for indexing
1. is there a good manual  for indexing

2.  is it possible to get !%in%
f.e
x =data.frame("A"=c(1:5),"C"=c("A","B","C","D","E"))
y =data.frame("B"=c(1,3,5))
test = x[x$A %in% y$B,]
test = x[x$A %in% y$B,]

test
A C
1 1 A
3 3 C
5 5 E


means: the result where I am looking for is:
test
A C
2 2 B
4 4 D

no problem with a loop but in a short way I do not find a solution

Kind Regards Knut

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

Peter Dalgaard-2


> On 25 Oct 2018, at 16:06 , Knut Krueger <[hidden email]> wrote:
>
> Hi Bert,
> another question for indexing
> 1. is there a good manual  for indexing

?Extract is at least authoritative....

>
> 2.  is it possible to get !%in%
> f.e


Yes: x[!(x$A %in% y$B),]

-pd

> x =data.frame("A"=c(1:5),"C"=c("A","B","C","D","E"))
> y =data.frame("B"=c(1,3,5))
> test = x[x$A %in% y$B,]
> test = x[x$A %in% y$B,]
>
> test
> A C
> 1 1 A
> 3 3 C
> 5 5 E
>
>
> means: the result where I am looking for is:
> test
> A C
> 2 2 B
> 4 4 D
>
> no problem with a loop but in a short way I do not find a solution
>
> Kind Regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

Rui Barradas
In reply to this post by Knut Krueger-8
Hello,

2. x[!x$A %in% y$B, ]

1.
An Introduction to R, file R-into.pdf in your docs folder.
http://www.cookbook-r.com/Basics/Indexing_into_a_data_structure/


Hope this helps,

Rui Barradas

Às 15:06 de 25/10/2018, Knut Krueger escreveu:

> Hi Bert,
> another question for indexing
> 1. is there a good manual  for indexing
>
> 2.  is it possible to get !%in%
> f.e
> x =data.frame("A"=c(1:5),"C"=c("A","B","C","D","E"))
> y =data.frame("B"=c(1,3,5))
> test = x[x$A %in% y$B,]
> test = x[x$A %in% y$B,]
>
> test
> A C
> 1 1 A
> 3 3 C
> 5 5 E
>
>
> means: the result where I am looking for is:
> test
> A C
> 2 2 B
> 4 4 D
>
> no problem with a loop but in a short way I do not find a solution
>
> Kind Regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

Knut Krueger-8
In reply to this post by Peter Dalgaard-2
Am 25.10.18 um 16:13 schrieb peter dalgaard:
>
>
> Yes: x[!(x$A %in% y$B),]

Ok thats in my opinion a little workaround
why?:

There is an
= and !=
< and >


means the opposite is available between terms.

why is there f.e no %!in%, %notin%  or !%in%

This would be more intuitive.

Kind regards Knut

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

Fox, John
In reply to this post by Peter Dalgaard-2
Dear Knut,

> -----Original Message-----
> From: R-help [mailto:[hidden email]] On Behalf Of Knut
> Krueger
> Sent: Friday, October 26, 2018 2:29 AM
> To: r-help mailing list <[hidden email]>
> Subject: Re: [R] "logical indexing, " [was] match() question or needle haystack
> problem for a data.frame
>
> Am 25.10.18 um 16:13 schrieb peter dalgaard:
> >
> >
> > Yes: x[!(x$A %in% y$B),]
>
> Ok thats in my opinion a little workaround

Not a work-around but a solution. That is, one can't expect to find an existing function for every problem.

> why?:
>
> There is an
> = and !=

Actually == and !=

> < and >
>
>
> means the opposite is available between terms.
>
> why is there f.e no %!in%, %notin%  or !%in%
>
> This would be more intuitive.

If you feel strongly about this, it's not hard to supply it:

> `%!in%` <- function(x, y) !(x %in% y)
> (1:4) %in% (2*1:4)
[1] FALSE  TRUE FALSE  TRUE
> (1:4) %!in% (2*1:4)
[1]  TRUE FALSE  TRUE FALSE

Best,
 John

-----------------------------------------------------------------
John Fox
Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: https://socialsciences.mcmaster.ca/jfox/


>
> Kind regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

David Winsemius
In reply to this post by Knut Krueger-8


> On Oct 25, 2018, at 11:28 PM, Knut Krueger <[hidden email]> wrote:
>
> Am 25.10.18 um 16:13 schrieb peter dalgaard:
>>
>> Yes: x[!(x$A %in% y$B),]
>
> Ok thats in my opinion a little workaround
> why?:
>
> There is an
> = and !=
> < and >
>
>
> means the opposite is available between terms.
>
> why is there f.e no %!in%, %notin%  or !%in%
>
> This would be more intuitive.

This illustrates a failure to read the obvious help page completely. The "Examples" section includes a definition of "%w/o%" which is exactly what was desired.

--
David.
>
> Kind regards Knut
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: "logical indexing, " [was] match() question or needle haystack problem for a data.frame

R help mailing list-2
In reply to this post by Knut Krueger-8
Wrong comparisons, I think.

The opposite of
  A & B
is
  !(A & B)

There is no single operator that can replace the "&" in A & B that gives the "opposite"

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 10/25/18, 11:28 PM, "R-help on behalf of Knut Krueger" <[hidden email] on behalf of [hidden email]> wrote:

    Am 25.10.18 um 16:13 schrieb peter dalgaard:
    >
    >
    > Yes: x[!(x$A %in% y$B),]
   
    Ok thats in my opinion a little workaround
    why?:
   
    There is an
    = and !=
    < and >
   
   
    means the opposite is available between terms.
   
    why is there f.e no %!in%, %notin%  or !%in%
   
    This would be more intuitive.
   
    Kind regards Knut
   
    ______________________________________________
    [hidden email] mailing list -- To UNSUBSCRIBE and more, see
    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.
   

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.