How To View The Source Code Of Ggplot2
1
1
Entering edit mode
10.2 years ago
Gangcai ▴ 230

Dear all, does anybody know how to check the source code of the functions of ggplot2?

> stat_density
function (mapping = NULL, data = NULL, geom = "area", position = "stack", 
    adjust = 1, kernel = "gaussian", trim = FALSE, na.rm = FALSE, 
    ...) 
{
    StatDensity$new(mapping = mapping, data = data, geom = geom, 
        position = position, adjust = adjust, kernel = kernel, 
        trim = trim, na.rm = na.rm, ...)
}
<environment: namespace:ggplot2>
r • 4.6k views
ADD COMMENT
4
Entering edit mode

Generally, exported function can be viewed within R as follows:

ggplot2::qplot

i.e. package_name [double colon] function_name.

Where a function is not exported to the user, you can access the source code of these using a triple colon.

ADD REPLY
4
Entering edit mode
10.2 years ago
Gangcai ▴ 230

One inconvenient way is to check the source code directly: https://github.com/hadley/ggplot2/blob/master/R

ADD COMMENT

Login before adding your answer.

Traffic: 1764 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6