title: Error when manipulating NAs with mutate() and case_when()
body: <p>I have a dataset with many missing values for the year of death. I want to replace those NAs by the year of birth + 79 which corresponds to the life expectancy in the US.</p>
  <pre><code>num_df = num_df %&gt;%
    mutate(
      gdc_cases.demographic.year_of_death = 
        case_when( 
           is.na(gdc_cases.demographic.year_of_death) ~ round(gdc_cases.demographic.year_of_birth + 79), 
          TRUE ~ gdc_cases.demographic.year_of_death)
      )
  </code></pre>
  <p>However, I obtain a message error and I am not sure how to fix it:</p>
  <pre><code>Error in mutate(., gdc_cases.demographic.year_of_death = case_when(is.na(gdc_cases.demographic.year_of_death) ~ : 
  
  Caused by error in `` names(message) &lt;- `*vtmp*` ``:
  ! 'names' attribute [1] must be the same length as the vector [0]
  </code></pre>
  <p>Thank you in advance!</p>
  <p><strong>DATA</strong></p>
  <p><a href="https://drive.google.com/file/d/1vhBXxgI-tF5VKy1agdM0uNTe49LRGHFa/view?usp=sharing" rel="nofollow noreferrer">RData file available here</a></p>
  <pre><code>rse_gene
  counts = assay(rse_gene)
  genes = rowData(rse_gene)
  sample = as.data.frame(colData(rse_gene))
  num_df= sample %&gt;% 
    dplyr::select(where(~!all(is.na(.x)))) %&gt;%
    dplyr::select(where(is.numeric)) 
  
  </code></pre>