Description Usage Arguments Examples
A more descriptive version of ls
.
1 |
name |
|
pos |
|
envir |
|
all.names |
|
pattern |
|
classFilter |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(name, pos=-1, envir=as.environment(pos), all.names=FALSE,
pattern, classFilter)
{
if( !missing(name) )
{
envir = name
} else
{
envir = parent.frame()
}
lsList = ls(name, pos, envir, all.names, pattern)
cat("\nName: Class, Length, Size\n")
cat("-------------------------\n")
for( item in lsList )
{
realItem = eval(parse(text = item), envir)
itemClass = class(realItem)
itemSize = object.size(realItem)
itemDimension = paste(dim(realItem), collapse="x" )
if( itemDimension == "" )
{
itemDimension = length(realItem)
}
classFilterMatches = !missing(classFilter) && itemClass == classFilter
if( classFilterMatches || missing(classFilter) )
{
format(cat(item, ": ", itemClass, ", ", itemDimension, ", ", itemSize,
"\n",
sep=""), justify="centre")
}
}
cat("\n")
invisible(lsList)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.