I want to multiply two data.frames that are of unequal length
If I have a data frame of observations (in reality this is around 30000 entries long)
Species number
1 3
1 3
3 5
4 40
5 22
and another data frame with conversion ratios for each species present in the first data frame (this is only about 120 entries in length)
species conversion ratio
1 3
2 5
3 4
4 2
5 2
and I want to multiply each number column entry by the conversion ratio entry associated with that Species, how might I go about doing this in R?
I’ve attempted using the match function to no avail, and my attempts at working with arrays have only resulted in errors, as well.
See
?merge. Assuming you havespeciesnamed consistently (capitals):