title: Coding Missing Data in R
body: <p>I have a dataset where inspection of the data shows some of the following, all of which should be missing</p>
  
  <pre><code>'missing'
  'unknown'
  'uncoded'
  </code></pre>
  
  <p>Am I correct in thinking that I can just replace all occurrences of these with "NA" ? Is this the preferred way of doing it ?</p>
  
  <pre><code>var[var=='missing'] &lt;- NA
  var[var=='unknown'] &lt;- NA
  var[var=='uncoded'] &lt;- NA
  </code></pre>