[R-gregmisc-users] SF.net SVN: r-gregmisc:[1582] trunk/SASxport/man/makeSASNames.Rd
Brought to you by:
warnes
From: <wa...@us...> - 2012-06-28 02:13:06
|
Revision: 1582 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1582&view=rev Author: warnes Date: 2012-06-28 02:13:00 +0000 (Thu, 28 Jun 2012) Log Message: ----------- Add man page for makeSASNames() function. Added Paths: ----------- trunk/SASxport/man/makeSASNames.Rd Added: trunk/SASxport/man/makeSASNames.Rd =================================================================== --- trunk/SASxport/man/makeSASNames.Rd (rev 0) +++ trunk/SASxport/man/makeSASNames.Rd 2012-06-28 02:13:00 UTC (rev 1582) @@ -0,0 +1,53 @@ +\name{makeSASNames} +\alias{makeSASNames} +\title{ + Create valid and unique SAS names from a character vector. +} +\description{ + Create valid and unique SAS names from a character vector. +} +\usage{ +makeSASNames(names, nchar = 8, maxPasses = 10) +} +\arguments{ + \item{names}{character vector of candidate names} + \item{nchar}{maximum number of characters} + \item{maxPasses}{maximum number of attempt to resolve + truncation-related conflicts.} +} +\details{ + This function creates valid SAS names from a list of R object or + column names, properly handling case conversion (all converted to + upper-case), length restructions (8 characters), and making duplicate + names unique. This is not as obvious as it appears, since the process + of shortening names can cause duplicates, and adding digits to the end + of names to make them unique can make them too long, so a few + iterations may be required to ensure valid and unique names. +} +\value{ + character vector of unique names valid in SAS. +} +\author{ + Gregory R. Warnes \email{gr...@wa...} +} +\seealso{ + make.names +} +\examples{ + ## Simple example: no duplicates or more than 8 characters + makeSASNames( c("height","weight","age","gender")) + + ## Resolve duplicates + makeSASNames( c("a","a","b","b","b","c") ) + + ## Truncate long names + makeSASNames( c("alphabetic", "numeric", "alphanumeric", "whitespace")) + + ## Truncate and make unique + makeSASNames( rep( c("aaaaaaaaaaa","bbbbbbbbbb"), each=3) ) + + ## Now do it quietly! + makeSASNames( rep( c("aaaaaaaaaaa","bbbbbbbbbb"), each=3), quiet=TRUE) +} +\keyword{manip} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |