[R-gregmisc-users] SF.net SVN: r-gregmisc: [1175] trunk/SASxport
Brought to you by:
warnes
From: <wa...@us...> - 2007-09-12 22:25:09
|
Revision: 1175 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1175&view=rev Author: warnes Date: 2007-09-12 15:25:07 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Remove units() and units<-() functions since they arene't ever used. Added Paths: ----------- trunk/SASxport/man/label.Rd Removed Paths: ------------- trunk/SASxport/R/units.R trunk/SASxport/man/units.Rd Deleted: trunk/SASxport/R/units.R =================================================================== --- trunk/SASxport/R/units.R 2007-09-12 22:24:11 UTC (rev 1174) +++ trunk/SASxport/R/units.R 2007-09-12 22:25:07 UTC (rev 1175) @@ -1,20 +0,0 @@ -units <- function(x, default) - UseMethod("units") - -units.default <- function(x, default=NULL) -{ - lab <- attr(x,"units") - if(is.null(lab)) - default - else - lab -} - -"units<-" <- function(x, value) - UseMethod("units<-") - -"units<-.default" <- function(x, value) -{ - attr(x,'units') <- value - x -} Copied: trunk/SASxport/man/label.Rd (from rev 1174, trunk/SASxport/man/units.Rd) =================================================================== --- trunk/SASxport/man/label.Rd (rev 0) +++ trunk/SASxport/man/label.Rd 2007-09-12 22:25:07 UTC (rev 1175) @@ -0,0 +1,90 @@ +\name{label} + +\alias{label} +\alias{label.default} +\alias{label<-} +\alias{label<-.default} + +\alias{formats} +\alias{formats.default} +\alias{formats<-} +\alias{formats<-.default} + +\alias{iformat} +\alias{iformat.default} +\alias{iformat<-} +\alias{iformat<-.default} + + +\title{ +Set or Retreive the 'label', 'format', or 'iformat' Attribute of a Vector +} +\description{ + Sets or retrieves the \code{"label"}, \code{"format"}, or + \code{"iformat"} attribute of an object. + + More comprehensive support for object labels, and formats, are + available in Frank Harrell's \code{Hmisc} package. +} +\usage{ +label(x, default) +label(x) <- value + +formats(x, default) +formats(x) <- value + +iformat(x, default) +iformat(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{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 + by \code{default}. +} +\author{Gregory R. Warnes \email{gr...@ra...} based + on code from the \code{Hmisc} library by Frank E. Harrell, Jr.} +%\seealso{ +%} +\examples{ + +fail.time <- c(10,20) + +# set attributes +label(fail.time) <- 'Failure Time' +formats(fail.time) <- 'Numeric2' +iformat(fail.time) <- 'Numeric2' + +# display individual attributes +label(fail.time) +formats(fail.time) +iformat(fail.time) + +# display all attributes +attributes(fail.time) + +# Example showing specification of default return value +a <- 70 +label(a, default="no label") + + +\dontrun{ +# for a nice display +library(Hmisc) +describe(fail.time) + +f <- cph(Surv(fail.time, event) ~ xx) +plot(xx,xx2,xlab=label(xx),"s",sep="")) +} + +} +\keyword{utilities} +\keyword{interface} + Deleted: trunk/SASxport/man/units.Rd =================================================================== --- trunk/SASxport/man/units.Rd 2007-09-12 22:24:11 UTC (rev 1174) +++ trunk/SASxport/man/units.Rd 2007-09-12 22:25:07 UTC (rev 1175) @@ -1,90 +0,0 @@ -\name{label} - -\alias{label} -\alias{label.default} -\alias{label<-} -\alias{label<-.default} - -\alias{formats} -\alias{formats.default} -\alias{formats<-} -\alias{formats<-.default} - -\alias{iformat} -\alias{iformat.default} -\alias{iformat<-} -\alias{iformat<-.default} - - -\title{ -Set or Retreive the 'label', 'format', or 'iformat' Attribute of a Vector -} -\description{ - Sets or retrieves the \code{"label"}, \code{"format"}, or - \code{"iformat"} attribute of an object. - - More comprehensive support for object labels, and formats, are - available in Frank Harrell's \code{Hmisc} package. -} -\usage{ -label(x, default) -label(x) <- value - -formats(x, default) -formats(x) <- value - -iformat(x, default) -iformat(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{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 - by \code{default}. -} -\author{Gregory R. Warnes \email{gr...@ra...} based - on code from the \code{Hmisc} library by Frank E. Harrell, Jr.} -%\seealso{ -%} -\examples{ - -fail.time <- c(10,20) - -# set attributes -label(fail.time) <- 'Failure Time' -formats(fail.time) <- 'Numeric2' -iformat(fail.time) <- 'Numeric2' - -# display individual attributes -label(fail.time) -formats(fail.time) -iformat(fail.time) - -# display all attributes -attributes(fail.time) - -# Example showing specification of default return value -a <- 70 -label(a, default="no label") - - -\dontrun{ -# for a nice display -library(Hmisc) -describe(fail.time) - -f <- cph(Surv(fail.time, event) ~ xx) -plot(xx,xx2,xlab=label(xx),"s",sep="")) -} - -} -\keyword{utilities} -\keyword{interface} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |