title: How to convert character(0) to NA in a list?
body: <p>How can <code>character(0)</code> be converted to <code>NA</code> in a list?</p>
  <p>Example:</p>
  <pre><code>a = list(&quot;a&quot;, character(0), &quot;b&quot;, &quot;c&quot;)
  </code></pre>
  <p>to</p>
  <pre><code>a = list(&quot;a&quot;, NA, &quot;b&quot;, &quot;c&quot;)
  </code></pre>