[R] Using ? for object summaries

Tom Smith mcmt84 at yahoo.com
Thu Mar 27 13:59:31 CET 2003


This short script makes ?name give help on "name" and
provides a summary of the variable "name"
[specifically, str("name") and summary ("name")]. I
add this to my .Rprofile to save my fingers some
typing.

"?" <- function(name) {
  try(str(name))
  options(show.error.messages = FALSE)
  try(print(summary(name)))
  try(do.call("help",list(deparse(substitute(name)))))
  options(show.error.messages = TRUE)
}



More information about the R-help mailing list