Hi Matthew, Thank you for the thoughtful reply. It's from a real example I am using where a master dataset is to be merged with other datasets by selected rows and columns(may or may not exist in master dataset). This function is call multiple times. As can see from the simple example, a master dataset is passed in by reference to avoid duplications.
As you also pointed out, alloc.col(DT, some large value) outside the function can fix this problem. But I am wondering if the all.col() call within the function could be more preferable? -- View this message in context: http://r.789695.n4.nabble.com/Fail-to-add-new-columns-within-a-function-tp4682173p4682250.html Sent from the datatable-help mailing list archive at Nabble.com. _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
