0

I am trying to create panel data set by joining Table 1 and Table 2

Table 1

Table 1

Table 2

Table 2

The output I would like to receive is that I will have 4 columns:

Powiat | Rok | Liczba bezrobotnych | Srednie wynagrodzenie

When I try to join these two tables with this line of code:

newtable <- left_join(bezrobotni, srednie, by = "Powiat",relationship = "many-to-many")

I receive such output:

Wrong output

I tried with different joins but the result is always this same. Do you know how to make it right?

2
  • 3
    try by = c("Powiat", "Rok") Commented Aug 16, 2023 at 11:25
  • @Julian has the right idea above. I would just add that if you aren't familiar with table joins and are expecting to keep the full match set from both Table 1 and Table 2, you should use a full_join(). Commented Aug 17, 2023 at 2:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.