PS:请把附件中的xh_device_SelectFunc.txt后缀改为xh_device_SelectFunc.R再运行。
- library(openxlsx)
- testdata <- read.xlsx("C:/Users/Administrator/Desktop/testdata.xlsx")
- xh_device_SelectFunc <- function(data){
- xh_reg <- data[grepl("徐汇",data$registorAddress),]
- temp <- data[!grepl("徐汇",data$registorAddress),]
- xh_pro <- temp[grepl("徐汇",temp$producedAddress),]
- temp <- temp[!grepl("徐汇",temp$producedAddress),]
- xh_agent <- temp[grepl("徐汇",temp$agentAddress),]
- xh_data <- rbind(xh_reg,xh_pro,xh_agent)
- return(xh_data)
- }
- xh_cndata <- xh_device_SelectFunc(data = testdata)


雷达卡





京公网安备 11010802022788号







