I have a large dataset that would look something like this:
| YEAR | SITE | VISIT |
|---|---|---|
| 2017 | KLM | 7 |
| 2017 | TVI | 4 |
| 2017 | OPP | 5 |
| 2017 | SVL | 13 |
| 2017 | PRL | 7 |
| 2018 | TVI | 15 |
| 2018 | SVL | 13 |
| 2018 | PRL | 3 |
| 2019 | KLM | 3 |
| 2019 | PRL | 3 |
| 2020 | TVI | 5 |
| 2020 | OPP | 5 |
| 2020 | SVL | 5 |
| 2021 | KLM | 10 |
| 2021 | OPP | 17 |
The range of sites it KLM, TVI, OPP, SVL, PRL As you can see not every year has the same sites. What I need to do is add all sites possible for each year and since there is no data for the visits, fill it with NA or 0 so it would look something like that:
| YEAR | SITE | VISIT |
|---|---|---|
| 2017 | KLM | 7 |
| 2017 | TVI | 4 |
| 2017 | OPP | 5 |
| 2017 | SVL | 13 |
| 2017 | PRL | 7 |
| 2018 | KLM | NA |
| 2018 | TVI | 15 |
| 2018 | OPP | NA |
| 2018 | SVL | 13 |
| 2018 | PRL | 3 |
| 2019 | KLM | 3 |
| 2019 | TVI | NA |
| 2019 | OPP | NA |
| 2019 | SVL | NA |
| 2019 | PRL | 3 |
| 2020 | KLM | NA |
| 2020 | TVI | 5 |
| 2020 | OPP | 5 |
| 2020 | SVL | 5 |
| 2020 | PRL | NA |
| 2021 | KLM | 10 |
| 2021 | TVI | NA |
| 2021 | OPP | 17 |
| 2021 | SVL | NA |
| 2021 | PRL | NA |
How would I go about it? I appreciate all suggestions and answers.