[R-gregmisc-users] SF.net SVN: r-gregmisc: [1209] trunk/SASxport/man
Brought to you by:
warnes
From: <wa...@us...> - 2007-11-01 06:43:25
|
Revision: 1209 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1209&view=rev Author: warnes Date: 2007-10-31 23:43:24 -0700 (Wed, 31 Oct 2007) Log Message: ----------- Update to match changes to functions Modified Paths: -------------- trunk/SASxport/man/SASxport-package.Rd trunk/SASxport/man/label.Rd trunk/SASxport/man/read.xport.Rd trunk/SASxport/man/toSAS.Rd trunk/SASxport/man/write.xport.Rd Modified: trunk/SASxport/man/SASxport-package.Rd =================================================================== --- trunk/SASxport/man/SASxport-package.Rd 2007-11-01 06:42:44 UTC (rev 1208) +++ trunk/SASxport/man/SASxport-package.Rd 2007-11-01 06:43:24 UTC (rev 1209) @@ -32,7 +32,7 @@ converting its argument to either a simple floating point or character variable (the only basic types permitted by the xport format) and adding the appropriate SAS format code in the - \code{"format"} attribute. + \code{"SASformat"} attribute. The \code{write.xport} function also allows the user to override the operating system type and SAS version information, as well as object @@ -45,8 +45,8 @@ read.xport Import SAS XPORT files toSAS.default Convert R data object for storage in SAS xport file -units Set or Retrieve the label, format, - iformat, or units Attribute of a Vector +units Set or Retrieve the label, SASformat, + SASiformat, or units Attribute of a Vector write.xport Write data to a SAS XPORT file } } Modified: trunk/SASxport/man/label.Rd =================================================================== --- trunk/SASxport/man/label.Rd 2007-11-01 06:42:44 UTC (rev 1208) +++ trunk/SASxport/man/label.Rd 2007-11-01 06:43:24 UTC (rev 1209) @@ -5,48 +5,48 @@ \alias{label<-} \alias{label<-.default} -\alias{formats} -\alias{formats.default} -\alias{formats<-} -\alias{formats<-.default} +\alias{SASformat} +\alias{SASformat.default} +\alias{SASformat<-} +\alias{SASformat<-.default} -\alias{iformat} -\alias{iformat.default} -\alias{iformat<-} -\alias{iformat<-.default} +\alias{SASiformat} +\alias{SASiformat.default} +\alias{SASiformat<-} +\alias{SASiformat<-.default} \title{ -Set or Retreive the 'label', 'format', or 'iformat' Attribute of a Vector +Set or Retreive the 'label', 'SASformat', or 'SASiformat' Attribute of a Vector } \description{ - Sets or retrieves the \code{"label"}, \code{"format"}, or - \code{"iformat"} attribute of an object. + Sets or retrieves the \code{"label"}, \code{"SASformat"}, or + \code{"SASiformat"} attribute of an object. - More comprehensive support for object labels, and formats, are + More comprehensive support for object labels, and SASformat, are available in Frank Harrell's \code{Hmisc} package. } \usage{ label(x, default) label(x) <- value -formats(x, default) -formats(x) <- value +SASformat(x, default) +SASformat(x) <- value -iformat(x, default) -iformat(x) <- value +SASiformat(x, default) +SASiformat(x) <- value } \arguments{ \item{x}{any object} -\item{value}{new value for the \code{"label"}, \code{"format"}, or - \code{"iformat"} attribute of an object.} +\item{value}{new value for the \code{"label"}, \code{"SASformat"}, or + \code{"SASiformat"} attribute of an object.} \item{default}{value to return when no appropriate attribute is found. The usual return value is NULL.} } \value{ - the contents of the \code{"label"}, \code{"format"}, or - \code{"iformat"} attribute of x, if any; otherwise, the value provided + the contents of the \code{"label"}, \code{"SASformat"}, or + \code{"SASiformat"} attribute of x, if any; otherwise, the value provided by \code{default}. } \author{Gregory R. Warnes \email{gr...@ra...} based @@ -59,13 +59,13 @@ # set attributes label(fail.time) <- 'Failure Time' -formats(fail.time) <- 'Numeric2' -iformat(fail.time) <- 'Numeric2' +SASformat(fail.time) <- 'Numeric2' +SASiformat(fail.time) <- 'Numeric2' # display individual attributes label(fail.time) -formats(fail.time) -iformat(fail.time) +SASformat(fail.time) +SASiformat(fail.time) # display all attributes attributes(fail.time) Modified: trunk/SASxport/man/read.xport.Rd =================================================================== --- trunk/SASxport/man/read.xport.Rd 2007-11-01 06:42:44 UTC (rev 1208) +++ trunk/SASxport/man/read.xport.Rd 2007-11-01 06:43:24 UTC (rev 1209) @@ -159,7 +159,6 @@ w <- read.xport('test2.xpt') } - # Or read a copy of test2.xpt available on the web: host <- 'http://biostat.mc.vanderbilt.edu' path <- '/cgi-bin/viewvc.cgi/*checkout*/Hmisc/trunk/tests/test2.xpt' @@ -178,6 +177,7 @@ SASxport:::assert( is.data.frame(w)==FALSE && is.list(w)==TRUE ) } + \dontrun{ ## The Hmisc library provides many useful functions for interacting with ## data imported from SAS via read.xport() Modified: trunk/SASxport/man/toSAS.Rd =================================================================== --- trunk/SASxport/man/toSAS.Rd 2007-11-01 06:42:44 UTC (rev 1208) +++ trunk/SASxport/man/toSAS.Rd 2007-11-01 06:43:24 UTC (rev 1209) @@ -15,11 +15,11 @@ } \usage{ toSAS(x, format, format.info=NULL) -\method{toSAS}{default}(x, format=formats(x), format.info=NULL) -\method{toSAS}{numeric}(x, format=formats(x), format.info=NULL) -\method{toSAS}{logical}(x, format=formats(x), format.info=NULL) -\method{toSAS}{character}(x, format=formats(x), format.info=NULL) -\method{toSAS}{factor}(x, format=formats(x), format.info=NULL) +\method{toSAS}{default}(x, format=SASformat(x), format.info=NULL) +\method{toSAS}{numeric}(x, format=SASformat(x), format.info=NULL) +\method{toSAS}{logical}(x, format=SASformat(x), format.info=NULL) +\method{toSAS}{character}(x, format=SASformat(x), format.info=NULL) +\method{toSAS}{factor}(x, format=SASformat(x), format.info=NULL) \method{toSAS}{POSIXt}( x, format="DATETIME16.", format.info=NULL) \method{toSAS}{Date}(x, format="DATE9.", format.info=NULL) } @@ -33,7 +33,7 @@ \code{toSAS} method. This method must convert the object data to either an object of type "numeric" (double-precision floating point) or type "character", the only basic types permitted by the xport - format, and should add an attribute named "format" to the object + format, and should add an attribute named "SASformat" to the object providing an appropriate SAS format string or "" (indicating the default SAS format). @@ -93,7 +93,7 @@ { retval <- ifelse(x=="Red", "#FF0000", ifelse(x=="Green", "#00FF00", "#0000FF") ) - attr(retval, "format") <- format + attr(retval, "SASformat") <- format retval } Modified: trunk/SASxport/man/write.xport.Rd =================================================================== --- trunk/SASxport/man/write.xport.Rd 2007-11-01 06:42:44 UTC (rev 1208) +++ trunk/SASxport/man/write.xport.Rd 2007-11-01 06:43:24 UTC (rev 1209) @@ -54,7 +54,7 @@ In addition, the SAS XPORT format allows each variable to have a corresponding label, display format, and input format. To set these - values, add the attribute 'label', 'format', or 'iformat' to + values, add the attribute 'label', 'SASformat', or 'SASiformat' to individual data frame variables. (See the example section.) The actual translation of R objects to objects appropriate for SAS is @@ -97,7 +97,7 @@ temp ## add a format specifier (not used by R) -attr(temp$x, 'format') <- 'date7.' +attr(temp$x, 'SASformat') <- 'date7.' ## add a variable label (not used by R) attr(temp$y, 'label') <- 'character variable' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |