R: What are operators like %in

前端 未结 4 1576
青春惊慌失措
青春惊慌失措 2020-12-02 13:46

I know the basics like == and !=, or even the difference (vaguely) between & and &&. But stuff like %in

4条回答
  •  被撕碎了的回忆
    2020-12-02 14:26

    The help file, and the general entry, is indeed a good starting point: ?'%in%'

    For example, you can see how the operator '%in%' is defined:

    "%in%" <- function(x, table) match(x, table, nomatch = 0) > 0

    You can even create your own operators:

    '%ni%' <- Negate('%in%')

提交回复
热议问题