zoukankan      html  css  js  c++  java
  • R比较两个文件中的名字是否重名

    b1.csv
    name
    zhangsan
    lisi
    
    aa.csv
    name
    zhangsan
    wangsi
    
    
    check_names <- function(file) {
      require(readr)
      check_file <- readr::read_delim(file=file,delim=" ",
                                      col_names = c("name"))
      aa <- readr::read_delim(file="/home/work/blue/aa.csv",delim=" ",
                                   col_names = c("name"))
      ret <- intersect(aa, check_file)
      ret
    }
    
    file = "/home/work/blue/b1.csv"
    abc <- check_names(file)
    abc

  • 相关阅读:
    iOS
    iOS
    iOS
    iOS
    iOS
    iOS
    iOS
    iOS
    iOS
    iOS
  • 原文地址:https://www.cnblogs.com/v5captain/p/13970191.html
Copyright © 2011-2022 走看看