This is an old revision of the document!


사업자번호구분 코드

Reg_classifier<-function(original_tbl, colname="사업자번호") {
  Reg<-eval(parse(text=paste0("original_tbl$",colname)))
  Reg2<-rep(0,length(Reg))

  tmp<-as.integer(substr(Reg,4,5))
  tmp[which(nchar(Reg)!= 10)]<-00
  tmp[which(is.na(Reg))]<-00

  Reg2[which(tmp>=01 & tmp<=79)]<-"개인과세사업자"
  Reg2[which(tmp>=90 & tmp<=99)]<-"개인면세사업자"
  Reg2[which(tmp==89)]<-"개인사업자_종교단체"
  Reg2[which(tmp==80)]<-"개인사업자_APT다단계"
  Reg2[which(tmp %in% c(81,86,87,88))]<-"법인본점"
  Reg2[which(tmp==82)]<-"법인비영리"
  Reg2[which(tmp==83)]<-"국가지자체"
  Reg2[which(tmp==84)]<-"법인외국"
  Reg2[which(tmp==85)]<-"법인지점"
  Reg2[which(nchar(Reg)!= 10)]<-"ERR"
  Reg2[which(is.na(Reg))]<-"ERR"

  Reg2
}
Enter your comment. Wiki syntax is allowed:
X P T K K
 
  • data_analysis/work/corp_code.1583288605.txt.gz
  • Last modified: 2025/07/07 14:12
  • (external edit)