R/CountAll.R

Defines functions CountAll

Documented in CountAll

CountAll <-
function(x=d, quiet=FALSE, ...)  {

  manage.gr <- .graphman()  # see if graphics are to be managed
  if (manage.gr)
    cat("\n>>> Note: Must have pdf_file specified or run in RStudio.\n\n")


  # let deprecated mydata work as default
  dfs <- .getdfs() 
  if ("mydata" %in% dfs  &&  !("d" %in% dfs)) x <- mydata 

  dname <- deparse(substitute(x))
  options(dname = dname)
  
  if (missing(x))
    if (!exists(dname, where=.GlobalEnv)) {
    cat("\n"); stop(call.=FALSE, "\n","------\n",
      "Need to specify an existing data frame,\n",
      "or data frame  d  must exist.\n\n")
    }
    
  if (!quiet) {
    cat("\n")
    .dash(25,"-")
    cat(format(Sys.time(), "%a %b %d, %Y at %H:%M"), "\n")
    .dash(25,"-")
  }

  if (!quiet) {
    cat("\n\n\n")
    .dash(37,"+")
    cat("Histogram for Each Numeric Variable\n")
    .dash(37,"+")
  }

  Histogram(data=x, quiet=quiet, eval_df=FALSE, ...)
  
  if (!quiet) {
    cat("\n\n\n")
    .dash(39,"+")
    cat("Bar Chart for Each Non-numeric Variable\n")
    .dash(39,"+")
  }
  BarChart(data=x, quiet=quiet, eval_df=FALSE, one_plot=FALSE, ...)
  
}

Try the lessR package in your browser

Any scripts or data that you put into this service are public.

lessR documentation built on June 23, 2024, 1:06 a.m.