funSource: Source code of a function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/funSource.R

Description

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

Usage

1
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 urls to files x.R and x.r. DEFAULT: TRUE

Value

links that are also opened with browseURL

Author(s)

Berry Boessenkool, [email protected], Jan+Dec 2016

See Also

https://github.com/brry/rskey to add this as a keyboard shortcut

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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")

## End(Not run)

## 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)

## End(Not run)

berryFunctions documentation built on Nov. 17, 2017, 7:29 a.m.