Retrieve a function's arguments and default values in a list.

FctArgs(name, sort = FALSE)

Arguments

name

name of the function.

sort

logical. Should the function arguments be sorted? Defaults to FALSE.

Value

a data.frame with the default in the first columns and with row.names as argument names.

Author

Andri Signorell <andri@signorell.net>

See also

formalArgs, formals, args, alist, body

Examples

formalArgs(PlotFdist)
#>  [1] "x"               "main"            "xlab"            "xlim"           
#>  [5] "args.hist"       "args.rug"        "args.dens"       "args.curve"     
#>  [9] "args.boxplot"    "args.ecdf"       "args.curve.ecdf" "heights"        
#> [13] "pdist"           "na.rm"           "cex.axis"        "cex.main"       
#> [17] "mar"             "las"            
formals(PlotFdist)
#> $x
#> 
#> 
#> $main
#> deparse(substitute(x))
#> 
#> $xlab
#> [1] ""
#> 
#> $xlim
#> NULL
#> 
#> $args.hist
#> NULL
#> 
#> $args.rug
#> [1] NA
#> 
#> $args.dens
#> NULL
#> 
#> $args.curve
#> [1] NA
#> 
#> $args.boxplot
#> NULL
#> 
#> $args.ecdf
#> NULL
#> 
#> $args.curve.ecdf
#> [1] NA
#> 
#> $heights
#> NULL
#> 
#> $pdist
#> NULL
#> 
#> $na.rm
#> [1] FALSE
#> 
#> $cex.axis
#> NULL
#> 
#> $cex.main
#> NULL
#> 
#> $mar
#> NULL
#> 
#> $las
#> [1] 1
#> 

# compare:
FctArgs(PlotFdist)
#>                 value                 
#> x                                     
#> main            deparse(substitute(x))
#> xlab            ""                    
#> xlim            NULL                  
#> args.hist       NULL                  
#> args.rug        NA                    
#> args.dens       NULL                  
#> args.curve      NA                    
#> args.boxplot    NULL                  
#> args.ecdf       NULL                  
#> args.curve.ecdf NA                    
#> heights         NULL                  
#> pdist           NULL                  
#> na.rm           FALSE                 
#> cex.axis        NULL                  
#> cex.main        NULL                  
#> mar             NULL                  
#> las             1