[datatable-help] Construct a new data table from another

Frank S. f_j_rod at hotmail.com
Mon Jul 21 16:48:29 CEST 2014


Thanks Chris, But, is there any option in order to avoid writing "with=FALSE" every timein the next situation?:  
# USING DATA FRAME set.seed(100)DF = data.frame(A=letters[1:5],B=rnorm(5),C=rexp(5),D=runif(5))DF2 <- data.frame(a=DF[,1],d=DF[,4],B=DF[,2])If I do the equivalent operations under data table format, I'm onñy able to obtain
the same result with the following code: # USING DATA TABLEset.seed(100)DT = data.table(A=letters[1:5],B=rnorm(5),C=rexp(5),D=runif(5))DT2 <- data.table(DT[,1,with=FALSE], DT[,4,with=FALSE], DT[,2,with=FALSE])setnames(DT2, c('a','d','B')) Thank you! 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20140721/fd90c389/attachment.html>


More information about the datatable-help mailing list