Run loop to match values from two different datasets

I have two data sets (freight and volume).

Columns in Freight (Origin port, Destination Port, Equipment size, Volume)

Columns in Volume (Origin port, Equipment size, Destination Port 1, Destination Port 2, Destination Port 3)

Now I need the volume in 'Freight dataset' to be filled out if it matches all the conditions.

I want to solve this through a loop, any ideas (beginner at R).

Thanks for the help!

A much better solution than a loop would be a dplyr "join", take a look at the documentation

https://dplyr.tidyverse.org/reference/join.html

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.