zoukankan      html  css  js  c++  java
  • R语言semi_join()和anti_join()

    Filtering joins filter rows from x based on the presence or absence of matches in y:

    semi_join() return all rows from x with a match in y.

    anti_join() return all rows from x without a match in y.

    # "Filtering" joins keep cases from the LHS
    band_members %>% semi_join(band_instruments)
    #> Joining, by = "name"
    #> # A tibble: 2 x 2
    #>   name  band   
    #>   <chr> <chr>  
    #> 1 John  Beatles
    #> 2 Paul  Beatles
    band_members %>% anti_join(band_instruments)
    #> Joining, by = "name"
    #> # A tibble: 1 x 2
    #>   name  band  
    #>   <chr> <chr> 
    #> 1 Mick  Stones
    

    semi_join只返回x表格中中可以跟y表格匹配的行,anti_join返回x表格中与y表格不匹配的行。

  • 相关阅读:
    ftell
    diff
    继承
    类的组合
    拷贝构造函数
    内存管理
    Hibernate学习-Hibernate查询语言HQL
    JAVA解析JSON数据
    Android异步加载
    Android数据存储-文件操作
  • 原文地址:https://www.cnblogs.com/yaos/p/14014130.html
Copyright © 2011-2022 走看看