There are three data sets
Parent Category:
ID
Ants
Cow
Dog
Hen
Tiger
df1:
ID Number1
Ants 6
Dog 2
Hen 7
df2:
ID Number2
Ants 5
Cow 7
Tiger 3
The final data (df3) should look like this:
ID Number1 Number2
Ants 6 5
Cow 0 7
Dog 2 0
Hen 7 0
Tiger 0 3
Is there any direct way to achieve this in R. I can do it in a manual way where I try to find out the missing values and then input it in each row and assign it to 0 and then arrange it in ascending order. Lastly I will merge the two data frames into one. But can we make a function that can do all this for us, with even more than two datasets.
I found a solution, here
but this is taking to much of time to run and showing the error Error: cannot allocate a vector of size 46.0 MB