<div>
                    Statquant,
                </div><div><br></div><div>I don't think this is a bug because the default NA is indeed NA_logical_</div><div><br></div><div>IF you do:</div><div><br></div><div>x <- rep(NA, 10)</div><div>class(x) # [1] logical</div><div><br></div><div>You should just do:</div><div><br></div><div>x <- rep(NA_integer_, 10)</div><div>class(x) # [1] integer</div><div><br></div><div>From ?NA (first paragraph)</div><div><span style="border-collapse: separate; font-family: sans-serif; border-spacing: 0px; "><code>NA</code> is a logical constant of length 1 which contains a missing value indicator. <code>NA</code> can be coerced to any other vector type except raw. There are also constants <code>NA_integer_</code>, <code>NA_real_</code>, <code>NA_complex_</code> and <code>NA_character_</code> of the other atomic vector types which support missing values: all of these are <a href="http://127.0.0.1:42400/help/library/base/help/reserved">reserved</a> words in the <font face="Courier New,Courier" color="#666666"><b>R</b></font> language.</span></div>
                <div><div><br></div><div>Arun</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Tuesday, September 3, 2013 at 4:36 PM, statquant3 wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>I filled a bug [#4878] following  this post</div><div><<a href="http://stackoverflow.com/questions/18594017/why-is-data-table-casting-automatically-when-i-assign-all-columns-by-reference/18594544?noredirect=1#18594544">http://stackoverflow.com/questions/18594017/why-is-data-table-casting-automatically-when-i-assign-all-columns-by-reference/18594544?noredirect=1#18594544</a>>  </div><div><br></div><div><br></div><div><br></div><div>--</div><div>View this message in context: <a href="http://r.789695.n4.nabble.com/Bug-filled-4878-tp4675263.html">http://r.789695.n4.nabble.com/Bug-filled-4878-tp4675263.html</a></div><div>Sent from the datatable-help mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.</div><div>_______________________________________________</div><div>datatable-help mailing list</div><div><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a></div><div><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>