Question: How To View The Source Code Of Ggplot2
1
gravatar for Gangcai
6.7 years ago by
Gangcai230
Berlin Or Shanghai
Gangcai230 wrote:

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 • 3.4k views
ADD COMMENTlink modified 6.5 years ago by Biostar ♦♦ 20 • written 6.7 years ago by Gangcai230
4

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 REPLYlink modified 6.7 years ago • written 6.7 years ago by KKeenan0270
4
gravatar for Gangcai
6.7 years ago by
Gangcai230
Berlin Or Shanghai
Gangcai230 wrote:

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

ADD COMMENTlink written 6.7 years ago by Gangcai230
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1391 users visited in the last hour