I 've two datasets : covid_19: DateRep : POSIXct, format: "2020-03-23" "2020-03-22" "2020-03-21" "2020-03-20" ...
Cases : num 10 0 2 0 0 1 5 6 3 3 ... Deaths : num 0 0 0 0 0 0 0 0 0 0 ...
Countries and territories: chr "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... GeoId : chr "AF" "AF" "AF" "AF" ...
**continent_country**
GeoId : Factor w/ 249 levels "AD","AE","AF",..: 1 2 3 4 5 6 7 8 9 10 ...
$ continent: Factor w/ 7 levels "--","AF","AN",..: 5 4 4 NA NA 5 4 NA 2 4 .
i want to bring them together by one extra column in Covid_19 continent. So when GeoId= AF (Afghanistan) in the new column i see in continent-column: AS (Asia)
How should i do this?
Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. The code here isn't enough to work the problem easily, so I'll just be able to point you the help(join) page in the dplyr package and show a toy example derived from the built-in mtcars dataset.
Thx, it was very helpfull. It took me a litlle time to implement in my case.
1 i had to rename a columnname (Countries and territories). this gave an error cause of the "and"
so my final code is now: