I have a list and a data frame
l <- list("a" = c(1, 2), "b" =c(1, 3))
id value
a 3
b 2
I want to get the rank of value in the data frame by id considering both list and data frame by matching id with list name. For example, if we consider a, 3 is the largest in 1, 2, 3, then we need to rank it as 1. Similar for b, 2 is the second largest in 1, 2, 3. we rank it as 2. The desired output should be
id value
a 1
b 2