[R-gregmisc-users] SF.net SVN: r-gregmisc:[1517] trunk/gtools
Brought to you by:
warnes
|
From: <wa...@us...> - 2011-10-05 16:53:45
|
Revision: 1517
http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1517&view=rev
Author: warnes
Date: 2011-10-05 16:53:39 +0000 (Wed, 05 Oct 2011)
Log Message:
-----------
Add 'sep' argument to smartbind() to allow specification of character used to separate components of constructed names
Modified Paths:
--------------
trunk/gtools/R/smartbind.R
trunk/gtools/man/smartbind.Rd
Modified: trunk/gtools/R/smartbind.R
===================================================================
--- trunk/gtools/R/smartbind.R 2011-10-05 15:31:55 UTC (rev 1516)
+++ trunk/gtools/R/smartbind.R 2011-10-05 16:53:39 UTC (rev 1517)
@@ -2,7 +2,7 @@
## Function to do rbind of data frames quickly, even if the columns don't match
##
-smartbind <- function(..., fill=NA)
+smartbind <- function(..., fill=NA, sep=':')
{
verbose <- FALSE
@@ -26,7 +26,7 @@
rowNameList <- unlist(lapply( names(data),
function(x)
if(rowLens[x]<=1) x
- else paste(x, seq(1,rowLens[x]),sep='.'))
+ else paste(x, seq(1,rowLens[x]),sep=sep))
)
Modified: trunk/gtools/man/smartbind.Rd
===================================================================
--- trunk/gtools/man/smartbind.Rd 2011-10-05 15:31:55 UTC (rev 1516)
+++ trunk/gtools/man/smartbind.Rd 2011-10-05 16:53:39 UTC (rev 1517)
@@ -5,12 +5,14 @@
Efficient rbind of data frames, even if the column names don't match
}
\usage{
-smartbind(..., fill=NA)
+smartbind(..., fill=NA, sep=':')
}
\arguments{
\item{\dots}{Data frames to combine}
\item{fill}{Value to use when 'filling' missing columns.
Defaults to \code{NA}. }
+ \item{sep}{Character string used to separate column names when pasting
+ them together.}
}
\value{
The returned data frame will contain:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|