R: find missing data and add it with a zero : <p>I have the following set of data:</p>

<p><a href="https://i.stack.imgur.com/wYwVy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYwVy.png" alt="enter image description here"></a></p>

<p>The rows in Yellow is an example of a good situation, because for Vaer=B both Var2=F and Var2=G a freq value is present.</p>

<p>But, rows in red are example of a bad situation, because row 13 where Var2=F have freq value at date 07.02.2018 but I do not have a value for Var2=G at the same date.</p>

<p>On the other hand, row 27 in red, I have freq value for Var2=G at date 04:02:2018 but I do not have freq value for Var2=F at the same date.</p>

<p><strong>What I need is:</strong>
For all type of Var1 (A, B, ..) and For each Var2 (F, G) If freq is present in Var2=F but not in Var2=G create for Var2=G freq=0 at the same date.</p>

<p>The same have to be mabe for Var2=G where Var2=F is not present.</p>

<p>Could you give me some idea how to do that in R?</p>
