funCode: Finding function source code

funCodeR Documentation

Finding function source code

Description

funCode function is to obtain the source code of an R function

Usage

funCode(f, ...)

## Default S3 method:
funCode(f = character(), pattern = NULL, envir = topenv(parent.frame()))

## S3 method for class 'ggproto_method'
funCode(f)

Arguments

f

a function name with or without quotation

pattern

regular expression to match the object class.

envir

environment to search

Value

A functionInfo object, containing the function name, function type, whether containing S3 or S4 methods, dirrect function source, S3 methods info, and S4 methods info.

Examples

## Not run: 
# The source of print
funCode(print)
funCode("print")

# The source of funCode
funCode(funCode)
funCode(lm)

# The source of plot for data.frame
funCode("plot", "data.frame")

# The source of standardGeneric show
funCode("show")
funCode(show)

# The source of ggproto_method in ggplot2
library(ggplot2)
funCode(Layout$setup)

## End(Not run)

paodan/funcTools documentation built on April 1, 2024, 12:01 a.m.