title: Error in R: mutate( ) must be size 4 or 1, not 0
body: <p>My data:</p>
  <pre><code>data_control &lt;-  structure(list(group = c(&quot;control&quot;, &quot;control&quot;, &quot;control&quot;, &quot;control&quot; ), cycle = c(0, 1, 2, 3), non_obese_prob = c(1, -0.0133333333333334, 0.00017777777777778, -0.00000237037037037042), obese_prob = c(0, 1.01333333333333, 0.999822222222222, 1.00000237037037)), row.names = c(NA, -4L), class = &quot;data.frame&quot;)
  
  data_qaly &lt;- structure(list(cycle = c(0, 1, 2, 3, 0, 1, 2, 3), qaly = c(0.879173868649325, 0.876535027508255, 0.876535027508255, 0.876535027508255, 0.729214080532041, 0.73572153807131, 0.73572153807131, 0.73572153807131), state = c(&quot;non_obese&quot;, &quot;non_obese&quot;, &quot;non_obese&quot;, &quot;non_obese&quot;, &quot;obese&quot;, &quot;obese&quot;, &quot;obese&quot;, &quot;obese&quot;)), row.names = c(NA, -8L), class = &quot;data.frame&quot;)
  
  </code></pre>
  <pre><code>data_control &lt;- data_control %&gt;% 
                  mutate(qaly_non_obese = data_qaly$qaly[data_qaly$state == &quot;non-obese&quot;]) %&gt;%
                  mutate(qaly_obese = data_qaly$qaly[data_qaly$state == &quot;obese&quot;])
  </code></pre>
  <p>Error: Problem with <code>mutate()</code> column <code>qaly_non_obese</code>.
  ℹ <code>qaly_non_obese = data_qaly$qaly[data_qaly$state == &quot;non-obese&quot;]</code>.
  ℹ <code>qaly_non_obese</code> must be size 4 or 1, not 0.</p>