[R-gregmisc-users] SF.net SVN: r-gregmisc:[1512] trunk/gtools
Brought to you by:
warnes
From: <wa...@us...> - 2011-09-28 22:53:53
|
Revision: 1512 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1512&view=rev Author: warnes Date: 2011-09-28 22:53:47 +0000 (Wed, 28 Sep 2011) Log Message: ----------- Add 'fill' argument to smartbind() to specify a value to use for missing entries. Modified Paths: -------------- trunk/gtools/R/smartbind.R trunk/gtools/inst/NEWS Modified: trunk/gtools/R/smartbind.R =================================================================== --- trunk/gtools/R/smartbind.R 2011-09-28 22:53:02 UTC (rev 1511) +++ trunk/gtools/R/smartbind.R 2011-09-28 22:53:47 UTC (rev 1512) @@ -2,7 +2,7 @@ ## Function to do rbind of data frames quickly, even if the columns don't match ## -smartbind <- function(...) +smartbind <- function(..., fill=NA) { verbose <- FALSE @@ -47,7 +47,7 @@ newclass <- "character" else newclass <- class(block[,col]) - retval[[col]] <- as.vector(rep(NA,nrows), mode=newclass) + retval[[col]] <- as.vector(rep(fill,nrows), mode=newclass) } retval[[col]][start:end] <- as.vector(block[,col], Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2011-09-28 22:53:02 UTC (rev 1511) +++ trunk/gtools/inst/NEWS 2011-09-28 22:53:47 UTC (rev 1512) @@ -1,4 +1,11 @@ +gtools 2.6.2 - 2011-09-28 +------------------------- +New features: + +- Add 'fill' argument to smartbind() to specify a value to use for + missing entries. + gtools 2.6.1 ------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |