[R-gregmisc-users] SF.net SVN: r-gregmisc: [1299] trunk/gdata
Brought to you by:
warnes
From: <ar...@us...> - 2008-06-30 22:29:39
|
Revision: 1299 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1299&view=rev Author: arnima Date: 2008-06-30 15:29:35 -0700 (Mon, 30 Jun 2008) Log Message: ----------- Simplified default 'unit' argument from c("KB","MB","bytes") to "KB". Modified Paths: -------------- trunk/gdata/R/env.R trunk/gdata/R/ll.R trunk/gdata/man/env.Rd trunk/gdata/man/ll.Rd Modified: trunk/gdata/R/env.R =================================================================== --- trunk/gdata/R/env.R 2008-06-23 23:51:13 UTC (rev 1298) +++ trunk/gdata/R/env.R 2008-06-30 22:29:35 UTC (rev 1299) @@ -1,6 +1,4 @@ -# $Id$ - -env <- function(unit=c("KB","MB","bytes"), digits=0) +env <- function(unit="KB", digits=0) { get.object.size <- function(object.name, pos) { @@ -26,7 +24,7 @@ return(nobjects) } - unit <- match.arg(unit) + unit <- match.arg(unit, c("bytes","KB","MB")) denominator <- switch(unit, "KB"=1024, "MB"=1024^2, 1) size.vector <- sapply(seq(along=search()), get.environment.size) size.vector <- round(size.vector/denominator, digits) Modified: trunk/gdata/R/ll.R =================================================================== --- trunk/gdata/R/ll.R 2008-06-23 23:51:13 UTC (rev 1298) +++ trunk/gdata/R/ll.R 2008-06-30 22:29:35 UTC (rev 1299) @@ -1,5 +1,5 @@ -ll <- function(pos=1, unit=c("KB","MB","bytes"), digits=0, dimensions=FALSE, - function.dim="", sort.elements=FALSE, ...) +ll <- function(pos=1, unit="KB", digits=0, dimensions=FALSE, function.dim="", + sort.elements=FALSE, ...) { get.object.classname <- function(object.name, pos) { @@ -29,7 +29,7 @@ return(size) } - unit <- match.arg(unit) + unit <- match.arg(unit, c("bytes","KB","MB")) denominator <- switch(unit, "KB"=1024, "MB"=1024^2, 1) if(is.character(pos)) # pos is an environment name Modified: trunk/gdata/man/env.Rd =================================================================== --- trunk/gdata/man/env.Rd 2008-06-23 23:51:13 UTC (rev 1298) +++ trunk/gdata/man/env.Rd 2008-06-30 22:29:35 UTC (rev 1299) @@ -7,7 +7,7 @@ Display name, number of objects, and size of all loaded environments. } \usage{ -env(unit=c("KB","MB","bytes"), digits=0) +env(unit="KB", digits=0) } \arguments{ \item{unit}{required unit for displaying environment size: "bytes", Modified: trunk/gdata/man/ll.Rd =================================================================== --- trunk/gdata/man/ll.Rd 2008-06-23 23:51:13 UTC (rev 1298) +++ trunk/gdata/man/ll.Rd 2008-06-30 22:29:35 UTC (rev 1299) @@ -9,8 +9,8 @@ object, its elements are listed and described. } \usage{ -ll(pos=1, unit=c("KB","MB","bytes"), digits=0, dimensions=FALSE, - function.dim="", sort.elements=FALSE, ...) +ll(pos=1, unit="KB", digits=0, dimensions=FALSE, function.dim="", + sort.elements=FALSE, ...) } \arguments{ \item{pos}{environment position number, environment name, data frame, @@ -39,8 +39,7 @@ } \author{Arni Magnusson \email{arnima@u.washington.edu}, with a - contribution by Jim Rogers - \email{jam...@pf...}} + contribution by Jim Rogers \email{jam...@pf...}} \seealso{ \code{\link{ls}} displays names of objects in a given environment. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |