[datatable-help] Fail to add new columns within a function

Arunkumar Srinivasan aragorn168b at gmail.com
Sat Dec 14 14:10:01 CET 2013


Hi Huashan,
Great reproducible example! Would you mind filing a bug report here (https://r-forge.r-project.org/tracker/?func=browse&group_id=240&atid=975)?
Thank you,
Arun


On Saturday, December 14, 2013 at 2:30 AM, Huashan Chen wrote:

> I just found out that when the column quota are reached, adding new columns
> within a function will fail.
> 
> Blow are the testing code:
> 
> testF2=function(x){ 
> add_var<-function(varname){
> x[, `:=`(eval(substitute(varname)), 1), with=F] 
> }
> sapply(paste0('a', 1:101), add_var)
> }
> 
> dd=data.table(a=1:3)
> truelength(dd)
> testF2(dd)
> dim(dd) # only 100 columns
> 
> dd[, new:=3]
> dim(dd) # adding new column outside a function is OK.
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Fail-to-add-new-columns-within-a-function-tp4682173.html
> Sent from the datatable-help mailing list archive at Nabble.com (http://Nabble.com).
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org (mailto:datatable-help at lists.r-forge.r-project.org)
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20131214/3fad8db9/attachment.html>


More information about the datatable-help mailing list