title: How to replace missing values with values from another variable in R? Object DF not found
body: <p>I have a data set with several missing values in "Actual" variable. Where "Actual" is missing, I'd like to replace with the value from the "Screener" variable. I have done some searching but all solutions give me a 'DF' not found error. Such as the one below. the data is imported from csv.</p>
  
  <pre><code>&gt; DF &lt;- transform(DF, ActualRecoded = ifelse(!is.na(Actual.Level),Actual.Level, Screener.Level))
  Error in transform(DF, ActualRecoded = ifelse(!is.na(Actual.Level),  : 
   object 'DF' not found
  </code></pre>
  
  <p>Here is an example of the data:</p>
  
  <pre><code>Screener.Level  Actual.Level
  High    
  High            High
  Low 
  Low 
  Medium 
  Medium  
  Medium  
  High    
  High            High
  Medium          Medium
  Medium  
  Medium  
  Medium          High
  Low             Low
  Medium  
  Medium          High
  High            High
  </code></pre>