Description Usage Arguments Value Author(s) See Also Examples
Another variant to provide a friendly "whatis" facility.
1 | whatis(ob)
|
ob |
An R language object. |
NULL |
At present, whatis is only used for the side effect of listing object information. |
G. Sawitzki
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 | whatis(whatis)
## The function is currently defined as
function (ob) {
obname<-deparse(substitute(ob))
cat(obname)
cat(" type=",typeof(ob),sep="")
cat(" mode=",mode(ob),sep="")
xx <- class(ob); if (!is.null(xx)) cat(paste(" class:",class(ob)))
cat(paste(" length=",length(ob)))
xx <- dim(ob); if (!is.null(xx)) cat(" dim=",xx)
xx <- names(attributes(ob))
if (!is.null(xx))
cat("\n"," names(attributes(", obname, "))=",xx,xxsep=" ")
xx <- dimnames(ob)
if (!is.null(xx)) {
xx <- names(xx)
if (!is.null(xx))
cat("\n"," names(dimnames(",obname,"))=",xx)
}
cat("\n")
if (typeof(ob)=="expression") {
cat("expression components: ");str(as.list(ob[[1]]))
}
} # whatis
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.