Learn R Programming

berryFunctions (version 1.15.0)

funSource: Source code of a function

Description

open source code of a function in a loaded or specified package on github.com/cran or github.com/wch/r-source

Usage

funSource(x, character.only = is.character(x), trydirect = TRUE)

Arguments

x
function name, with or without quotation marks
character.only
If TRUE, look for SomeFun instead of MyFun if MyFun <- "SomeFun". DEFAULT: is.character(x)
trydirect
If TRUE, try direct url to file x.R. DEFAULT: TRUE

Value

links that are also opened with browseURL

Examples

Run this code
## Not run: ------------------------------------
#  ## browser windows should not be openend in CRAN checks
# library("berryFunctions")
# funSource(colPoints) 
# funSource("head") 
# funSource("require", trydirect=FALSE) 
# 
# funSource(earthDist) 
# funSource(OSMscale::earthDist) 
# funSource("OSMscale::earthDist") 
## ---------------------------------------------

## Not run: ------------------------------------
#  # developmental testing
# require(plotrix); require(scales)
# funSource(rescale
# 
# tail <- function(...) stop("This is a dummy function. Type: rm(tail)")
# funSource("tail")
# rm(tail)
## ---------------------------------------------

Run the code above in your browser using DataLab