Getting heplot function arguments from the heplots R package

Getting the arguments to a function is R

pretty straightforward and can be retrieved using args(functionname)

. But I couldn't figure out how to get the function arguments heplot

from the package heplots

. Any help would be much appreciated. Thanks to

library(heplots)
?heplot
args(heplot)

function (mod, ...) 
NULL

      

Want to get the next part

## S3 method for class 'mlm'
heplot(mod, terms, hypotheses, term.labels = TRUE,
    hyp.labels = TRUE, err.label="Error", label.pos=NULL,
    variables = 1:2, error.ellipse = !add, 
    factor.means = !add, grand.mean = !add, remove.intercept = TRUE,
    type = c("II", "III", "2", "3"), idata=NULL, idesign=NULL,
    icontrasts=c("contr.sum", "contr.poly"),
    imatrix=NULL, iterm=NULL, markH0=!is.null(iterm),
    manova, size = c("evidence", "effect.size"),
    level = 0.68, alpha = 0.05, segments = 40, 
    center.pch = "+", center.cex=2,
    col = getOption("heplot.colors", 
               c("red", "blue", "black", "darkgreen", 
                 "darkcyan","magenta", "brown","darkgray")),
    lty = 2:1, lwd = 1:2, 
    fill=FALSE, fill.alpha=0.3,   
    xlab, ylab, main = "", xlim, ylim, axes=TRUE, offset.axes, 
    add = FALSE, verbose = FALSE, warn.rank = FALSE, ...)

      

+3


source to share


1 answer


heplot

is a common function of S3. It uses a method heplot.mlm

that is a non-exportable function. You can access this information by first looking at the function body heplot

. If you see UseMethod

in the body of a function, the function uses the method. All available methods for common S3 functions can be accessed withmethods

> methods(heplot)

      

To access the non-exported function, you can use :::

. Wrap that call with a args

and you have the argument list you are looking for.

> args(heplots:::heplot.mlm)
# function (mod, terms, hypotheses, term.labels = TRUE, hyp.labels = TRUE, 
#     err.label = "Error", label.pos = NULL, variables = 1:2, error.ellipse = !add, 
#     factor.means = !add, grand.mean = !add, remove.intercept = TRUE, 
#     type = c("II", "III", "2", "3"), idata = NULL, idesign = NULL, 
#     icontrasts = c("contr.sum", "contr.poly"), imatrix = NULL, 
#     iterm = NULL, markH0 = !is.null(iterm), manova, size = c("evidence", 
#         "effect.size"), level = 0.68, alpha = 0.05, segments = 40, 
#     center.pch = "+", center.cex = 2, col = getOption("heplot.colors", 
#         c("red", "blue", "black", "darkgreen", "darkcyan", "magenta", 
#             "brown", "darkgray")), lty = 2:1, lwd = 1:2, fill = FALSE, 
#     fill.alpha = 0.3, xlab, ylab, main = "", xlim, ylim, axes = TRUE, 
#     offset.axes, add = FALSE, verbose = FALSE, warn.rank = FALSE, 
#     ...) 
# NULL

      



Note. This function obviously has many arguments, so

> formals(args(heplots:::heplot.mlm))  ## or as.list()

      

might be a more convenient and understandable way to iterate over the list of arguments.

+4


source







All Articles