title: how to resolve, problem w mutate must be size 1, not 2
body: <p>I have a simple df that has columns (segment, study_name, Effective_Overall_TopboxMean, and a few other numerical based fields).</p>
  <p>Dput is here:</p>
  <pre><code>structure(list(segment = c(&quot;Developers&quot;, &quot;lowcode&quot;), study_name = c(&quot;DeleteMe&quot;, 
      &quot;DeleteMe&quot;), Effective_Overall_TopboxMean = c(0.96875, 0.5), 
          Effective_Effective_TopboxMean = c(1, 0.571428571428571), 
          Effective_Useful_TopboxMean = c(1,0.571428571428571),Effective_Performant_TopboxMean = c(0.916666666666667, 
          0.380952380952381), Efficient_Overall_TopboxMean = c(0.765625, 
          0.357142857142857), Efficient_Efficient_TopboxMean = c(0.78125, 
          0.357142857142857), Efficient_Ease_TopboxMean = c(0.796875, 
          0.321428571428571), Efficient_Learn_TopboxMean = c(0.6875, 
          0.428571428571429), Empowered_Overall_TopboxMean = c(0.8375, 
          0.414285714285714), Empowered_Satisfaction_TopboxMean = c(0.84375, 
          0.321428571428571), Empowered_Empowered_TopboxMean = c(0.75, 
          0.523809523809524), Empowered_Enjoyable_TopboxMean = c(0.916666666666667, 
          0.428571428571429), UXQ_Overall_TopboxMean = c(0.827205882352941, 
          0.411764705882353), USE_Mean = c(0.816825396825397, 0.816825396825397
          ), USE_Usefulness_Mean = c(0.851190476190476, 0.851190476190476
          ), USE_Ease_Mean = c(0.774891774891775, 0.774891774891775
          ), USE_Learning_Mean = c(0.814285714285714, 0.814285714285714
          ), USE_Satisfaction_Mean = c(0.844897959183673, 0.844897959183673
          ), USE_SNOW_Mean = c(0.811904761904762, 0.811904761904762
          ), UXQ_Overall_Mean = c(0.81624649859944, 0.81624649859944
          ), run_date = structure(c(18865, 18865), class = &quot;Date&quot;), 
          TaskCompletionRate = c(0.561904761904762, 0.561904761904762
          ), WeightedScore = c(0, 0), ExperienceGrade = c(&quot;F Unacceptable&quot;, 
          &quot;F Unacceptable&quot;)), row.names = c(NA, -2L), groups = structure(list(
          segment = c(&quot;Developers&quot;, &quot;lowcode&quot;), .rows = structure(list(
              1L, 2L), ptype = integer(0), class = c(&quot;vctrs_list_of&quot;, 
          &quot;vctrs_vctr&quot;, &quot;list&quot;))), row.names = c(NA, -2L), class = c(&quot;tbl_df&quot;, 
      &quot;tbl&quot;, &quot;data.frame&quot;), .drop = TRUE), class = c(&quot;grouped_df&quot;, 
      &quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;))'
  </code></pre>
  <p>My mutate with if / else statements use to work, but today it seems to have broken and I cannot resolve the error message:&quot;</p>
  <pre><code>'Error: Problem with `mutate()` column `WeightedEffective`.
  ℹ `WeightedEffective = if (...) NULL`.
  ℹ `WeightedEffective` must be size 1, not 2.
  ℹ The error occurred in group 1: segment = &quot;Developers&quot;.
  Run `rlang::last_error()` to see where the error occurred.
  In addition: Warning messages:
  1: Problem with `mutate()` column `WeightedEffective`.
  ℹ `WeightedEffective = if (...) NULL`.
  ℹ the condition has length &gt; 1 and only the first element will be used
  ℹ The warning occurred in group 1: segment = &quot;Developers&quot;. 
  2: Problem with `mutate()` column `WeightedEffective`.
  ℹ `WeightedEffective = if (...) NULL`.
  ℹ the condition has length &gt; 1 and only the first element will be used
  ℹ The warning occurred in group 1: segment = &quot;Developers&quot;. 
  3: Problem with `mutate()` column `WeightedEffective`.
  ℹ `WeightedEffective = if (...) NULL`.
  ℹ the condition has length &gt; 1 and only the first element will be used
  ℹ The warning occurred in group 1: segment = &quot;Developers&quot;. 
  4: Problem with `mutate()` column `WeightedEffective`.
  ℹ `WeightedEffective = if (...) NULL`.
  ℹ the condition has length &gt; 1 and only the first element will be used
  ℹ The warning occurred in group 1: segment = &quot;Developers&quot;. '
  </code></pre>
  <p>This is the script I have:</p>
  <pre><code>    UXQ_Boxes &lt;- mutate(UXQ_Boxes,WeightedEffective = 
  if (UXQ_Boxes$TaskCompletionRate &gt;.900){
      (UXQ_Boxes$Effective_Overall_TopboxMean)*1
    } else {
      if (UXQ_Boxes$TaskCompletionRate &gt;.790){
        ((UXQ_Boxes$Effective_Overall_TopboxMean)*.9)*100
      } else {
        if (UXQ_Boxes$TaskCompletionRate &gt;.650){
         ((UXQ_Boxes$Effective_Overall_TopboxMean)*.8)*100
        } else {
          if (UXQ_Boxes$TaskCompletionRate &gt;.500){
         ((UXQ_Boxes$Effective_Overall_TopboxMean)*.6)*100
          } else {
            if (UXQ_Boxes$TaskCompletionRate &gt;.250){
         ((UXQ_Boxes$Effective_Overall_TopboxMean)*.4)*100
            } else {
              if (UXQ_Boxes$TaskCompletionRate &lt;.260){
         ((UXQ_Boxes$Effective_Overall_TopboxMean)*.2)*100
              }}}}}}*6)'
  </code></pre>
  <p>Any advice on how to resolve this would be greatly appreciated.</p>