Say we have this vector:
products <- c(a, b, d, f, g, h, i, j, m, o, t, z)
And a dataframe like this one below:
seller_a seller_b seller_c
a b d
d d e
g g g
h l h
t n t
z y w
I would like to include an additional row into the dataframe which would signal to what extend each seller column matches the products vector.
In other words, my goal is to get the original dataframe to look like this:
seller_a seller_b seller_c
6 3 4
a b d
d d e
g g g
h l h
t n t
z y w
using
summarisewithacrossindplyrCreated on 2021-06-07 by the reprex package (v2.0.0)