How to replicate every element of a column a for all elements of a column b?
<p>I have a data frame with the following columns:</p>

<p>Month: string</p>

<p>Name: string</p>

<p>Count: number.</p>

<p>I'd like to take the month column and replicate all names in the different months in order to know where the count was 0 because in the data set if a name has no count, the date is not recorded.</p>

<p>reproducible example:</p>

<pre><code>test &lt;- data.frame(month = c("Jan","Feb","Mar","Apr","Jan","Mar","Apr"), name = c("A","A","A","A","B","B","B"), count = c(1,4,5,7,3,2,5))

# Desired result

testresult &lt;- data.frame(month = c("Jan","Feb","Mar","Apr","Jan","Feb","Mar","Apr"), name = c("A","A","A","A","B","B","B","B"), count = c(1,4,5,7,3,0,2,5))
</code></pre>