#' multiIncl
#'
#' @export
multiIncl<-function(x,y){
if(y=='[NULL]'){
T->res
} else {
unlist(stri_split_fixed(y,';'))->Y
sapply(Y,function(i){
stri_detect_regex(x,i)
})->resi
res<-ifelse(sum(resi,na.rm=T)>=2,T,F)
}
return(res)
}
#' multiIncl2
#'
#' revise multiIncl fun
#'
#' @export
multiIncl2<-function(x,y){
stri_replace_all_fixed(y,'\\','')->y
unlist(stri_split_fixed(x,';'))->x2
if(y=='[NULL]'){
T->res
} else {
if(y=='(NtAvb)'){
res<-x=='NtAvb'
} else {
if(grepl("(",y,fixed=T)){
unlist(stri_split_fixed(y,';'))->Y
if(length(Y)>1){
setdiff(unlist(stri_split_regex(Y[1],'[\\(\\)|]')),c('',NA))->Y1
setdiff(unlist(stri_split_regex(Y[2],'[\\(\\)|]')),c('',NA))->Y2
# res<-stri_detect_regex(x,Y[1])&stri_detect_regex(x,Y[2])
res<-any(is.element(x2,Y1))&any(is.element(x2,Y2))
} else {
setdiff(unlist(stri_split_regex(Y,'[\\(\\)|]')),c('',NA))->Y0
res<-any(is.element(x2,Y0))
# res<-stri_detect_regex(x,Y)
}
}
}
}
return(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.