title: In R, how can I conditionally set a named list's element equal to the name for that element?
body: <p>I have a named list, it looks like this:</p>
  
  <pre><code>ENSG00000283891 ENSG00000251931 ENSG00000207766 ENSG00000276678 ENSG00000207260 ENSG00000265993 ENSG00000207185 ENSG00000283793 ENSG00000201545 
     "MIR628"     "RNU6-871P"        "MIR626"              ""      "RNU6-35P"       "MIR5694"    "RNU6-1157P"       "MIR6861"      "RNU4-85P"
  </code></pre>
  
  <p>I want to set any fields that are empty, (that are: "" ), to their associated name.  So the fourth item in this example is an empty string.  I would like to change the value of that empty string to be the name instead, so it should become, "ENSG00000276678".</p>
  
  <p>Does anyone know a good way to do this?  I feel like there should be a good ifelse out there for this or some very straightforward way to do it, but I haven't been able to find it yet.  Thanks very much.</p>