Hello @neeraj_24,
I adjusted your problem slightly as a and b need the same length. You will see I simply transposed and converted to dataframe. Thereafter, I performed a mutate to create when which is larger than the other. FInally I used group_by and summarise to show me how much it was true for which row.
library(tidyverse)
a <- c(1,2,3,4)
b <- c(-3,4,9,2)
c <- rbind(a,b) %>% t() %>% as.data.frame()
df <- c %>% mutate(comparison = ifelse(a > b, "a","b"))
df %>% group_by(comparison) %>% summarise(n())
#> `summarise()` ungrouping output (override with `.groups` argument)
#> # A tibble: 2 x 2
#> comparison `n()`
#> <chr> <int>
#> 1 a 2
#> 2 b 2
Created on 2020-10-12 by the reprex package (v0.3.0)