본문 바로가기

R관련/Rfunction

multi_grep

728x90
반응형

#--------------------
# Multi_grep
#--------------------
multi_grep=function(input=c(),pattern=c(),ignore.case=T,fixed=F){
  if(is.null(input)){
    print('input : input character vector')
    print('pattern : pattern list character vector')
    print('ignore.case (default T) : same with ignore.case')
    print('Output will be unique list of sites')
  }else{
    wh=c();for(j in 1:length(pattern)){
      wh=c(wh,grep(input,pattern = pattern[j],ignore.case = ignore.case,fixed = fixed))
    }
    wh=unique(wh)
    return(wh)
  }
}

728x90
반응형

'R관련 > Rfunction' 카테고리의 다른 글

survival analysis function  (0) 2019.03.21
GSEA Enrichment Score calculation  (0) 2019.02.27
scanning ks-test  (0) 2018.03.02
domain_annotation  (0) 2017.07.21
IC50, drc  (0) 2017.07.21