I prefer line lists for data
recording any type of survey data.
These line lists only recorded “cases” and therefore are missing any time the
data are 0.
Thus, I’m often in the scenario where I want to
complete
the data so that 0s are included.
Imagine the real data are
But if we record only the non-zero counts, we have the following incomplete
data.frame.
So, we need to complete this data frame so that it looks just like the
original.
We don’t have all the information in d_incomplete because we don’t even
know that surveys were completed in 2018 or in month 5 of year 2019.
So, we have another source of information that tells us about which surveys
occurred.
Now, we can augment this surveys data frame with the species information
by merging two data.frames
Finally we can
join
the incomplete data.frame with this data.frame that contains all the surveys
and species.
This will create NAs that we will with 0.
I’m not thrilled with this solution, but at least it is a solution