I have a vector of names:
nums = 1:5
names = paste("name_", nums, sep="")
And a data frame where col1 contains a subset of the values listed in names:
Name Count
name_1 14
name_3 2
name_5 11
I would like to use the vector of names to add rows to the data frame for names that are currently missing from the data frame, so that the final product looks like this:
Name Count
name_1 14
name_2 0
name_3 2
name_4 0
name_5 11
I've come across some other variations of this question, but can't seem to find a solution that matches my scenario. Thanks for any help!