I want to compare data two different table like that using R.

    Table 1  
    X1     
    a;b
    c
    d;e
    
    Table 2
    Y1
    a    uuu   uu
    b    vvv   vv
    c    xxx   xx
    d    yyy   yy
     e    zzz   zz
    
     Ouptput Table 3
    X1     Y2
    a;b    uuu|uu<\br>vvv|vv
    c      xxx|xx
    d;e    yyy|yy<\br>zzz|zz
Here is the dplyr way. Make sure that you provide column names as given in `t1` and `t2`

        library(tidyverse)
        t1 <- tibble(X1 = c("a;b","c","d;e"))
        t2 <- tibble(Y1 =letters[1:5] , Y2 = c("uuu","vvv","xxx","yyy","zzz") ,Y3 =c("uu","vv","xx","yy","zz"))
        
        
        t3 <- t1 %>% 
          mutate(mm = map(X1, ~(strsplit(.,split = ";"))[[1]] %>% as_tibble)) %>% 
          mutate(nn  = map(mm , function(.){
            col_binds <- left_join(.,t2, by = c("value" = "Y1")) %>% 
              unite(col = "comb",sep = "|" , Y2:Y3)
            row_binds <- col_binds %>% 
              summarise(value  = paste0(value , collapse = ";")  , times = paste0(comb , collapse = "<\br>"))
            return(row_binds)
          })) %>% 
          select(nn) %>%
          unnest() %>% 
          dplyr::rename(X1 = value , Y2 = times) 
    
    ## output
    t3
    # A tibble: 3 x 2
      X1    Y2                 
      <chr> <chr>              
    1 a;b   "uuu|uu<\br>vvv|vv"
    2 c     xxx|xx             
    3 d;e   "yyy|yy<\br>zzz|zz"

