Skip to content
This repository was archived by the owner on Oct 27, 2018. It is now read-only.

tidyverse/ggplot2-docs

Repository files navigation

<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
  <head>
  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Contributing to ggplot2 development • ggplot2</title>

<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>

<!-- Bootstrap -->
<link href="tidyverse.css" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<!-- tidyverse -->
<link href="pkgdown.css" rel="stylesheet">
<script src="jquery.sticky-kit.min.js"></script>
<script src="pkgdown.js"></script>

<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
  </head>

  <body>
    <div class="container template-title-body">
      <header>
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>

      <div class="navbar-brand-container">
        <a class="navbar-brand" href="index.html">ggplot2</a>
        <small class="tidyverse">part of the <a href="http://tidyverse.org">tidyverse</a></small>
      </div>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li>
      <a href="articles/ggplot2-specs.html">Aesthetic specifications</a>
    </li>
    <li>
      <a href="articles/extending-ggplot2.html">Extending ggplot2</a>
    </li>
  </ul>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    News
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li class="dropdown-header">Release notes</li>
    <li>
      <a href="articles/releases/ggplot2-2.2.0.html">Version 2.2.0</a>
    </li>
    <li>
      <a href="articles/releases/ggplot2-2.1.0.html">Version 2.1.0</a>
    </li>
    <li>
      <a href="articles/releases/ggplot2-2.0.0.html">Version 2.0.0</a>
    </li>
    <li>
      <a href="articles/releases/ggplot2-1.0.0.html">Version 1.0.0</a>
    </li>
    <li class="divider"></li>
    <li>
      <a href="news/index.html">Change log</a>
    </li>
  </ul>
</li>
        <li>
  <a href="https://github.com/tidyverse/ggplot2">
    <span class="fa fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      
      </header>

<div class="row">
  <div class="contents col-md-9">
    <div class="page-header">
      <h1>Contributing to ggplot2 development</h1>
    </div>

<div id="contributing-to-ggplot2-development" class="section level1">

<p>The goal of this guide is to help you get up and contributing to ggplot2 as quickly as possible. The guide is divided into two main pieces:</p>
<ol>
<li>Filing a bug report or feature request in an issue.</li>
<li>Suggesting a change via a pull request.</li>
</ol>
<div id="issues" class="section level2">
<h2 class="hasAnchor">
<a href="#issues" class="anchor"></a>Issues</h2>
<p>When filing an issue, the most important thing is to include a minimal reproducible example so that we can quickly verify the problem, and then figure out how to fix it. There are three things you need to include to make your example reproducible: required packages, data, code.</p>
<ol>
<li><p><strong>Packages</strong> should be loaded at the top of the script, so it’s easy to see which ones the example needs.</p></li>
<li>
<p>The easiest way to include <strong>data</strong> is to use <code>dput()</code> to generate the R code to recreate it. For example, to recreate the <code>mtcars</code> dataset in R, I’d perform the following steps:</p>
<ol>
<li>Run <code>dput(mtcars)</code> in R</li>
<li>Copy the output</li>
<li>In my reproducible script, type <code>mtcars &lt;-</code> then paste.</li>
</ol>
<p>But even better is if you can create a <code>data.frame()</code> with just a handful of rows and columns that still illustrates the problem.</p>
</li>
<li>
<p>Spend a little bit of time ensuring that your <strong>code</strong> is easy for others to read:</p>
<ul>
<li><p>make sure you’ve used spaces and your variable names are concise, but informative</p></li>
<li><p>use comments to indicate where your problem lies</p></li>
<li><p>do your best to remove everything that is not related to the problem.<br>
The shorter your code is, the easier it is to understand.</p></li>
</ul>
</li>
</ol>
<p>You can check you have actually made a reproducible example by starting up a fresh R session and pasting your script in.</p>
<p>(Unless you’ve been specifically asked for it, please don’t include the output of <code>sessionInfo()</code>.)</p>
</div>
<div id="pull-requests" class="section level2">
<h2 class="hasAnchor">
<a href="#pull-requests" class="anchor"></a>Pull requests</h2>
<p>To contribute a change to ggplot2, you follow these steps:</p>
<ol>
<li>Create a branch in git and make your changes.</li>
<li>Push branch to github and issue pull request (PR).</li>
<li>Discuss the pull request.</li>
<li>Iterate until either we accept the PR or decide that it’s not a good fit for ggplot2.</li>
</ol>
<p>Each of these steps are described in more detail below. This might feel overwhelming the first time you get set up, but it gets easier with practice. If you get stuck at any point, please reach out for help on the <a href="https://groups.google.com/forum/#!forum/ggplot2-dev">ggplot2-dev</a> mailing list.</p>
<p>If you’re not familiar with git or github, please start by reading <a href="http://r-pkgs.had.co.nz/git.html" class="uri">http://r-pkgs.had.co.nz/git.html</a></p>
<!--
* [ ] Motivate the change in one paragraph, and include it in NEWS.
      In parentheses, reference your github user name and this issue:
      `(@hadley, #1234)`
* [ ] Check pull request only includes relevant changes.
* [ ] Use the [official style](http://adv-r.had.co.nz/Style.html).
* [ ] Update documentation and re-run roxygen2
* [ ] Add test, if bug in non-graphical function
* [ ] Add visual test, if bug in graphical function
* [ ] Add minimal example, if new graphical feature

See http://docs.ggplot2.org/dev/vignettes/development.html for more details.
--->
<p>Pull requests will be evaluated against a seven point checklist:</p>
<ol>
<li>
<strong>Motivation</strong>. Your pull request should clearly and concisely motivates the need for change. Unfortunately neither Winston nor I have much time to work on ggplot2 these days, so you need to describe the problem and show how your pull request solves it as concisely as possible.</li>
</ol>
<p>Also include this motivation in <code>NEWS</code> so that when a new release of ggplot2 comes out it’s easy for users to see what’s changed. Add your item at the top of the file and use markdown for formatting. The news item should end with <code>(@yourGithubUsername, #the_issue_number)</code>.</p>
<ol>
<li>
<p><strong>Only related changes</strong>. Before you submit your pull request, please check to make sure that you haven’t accidentally included any unrelated changes. These make it harder to see exactly what’s changed, and to evaluate any unexpected side effects.</p>
<p>Each PR corresponds to a git branch, so if you expect to submit multiple changes make sure to create multiple branches. If you have multiple changes that depend on each other, start with the first one and don’t submit any others until the first one has been processed.</p>
</li>
<li><p><strong>Use ggplot2 coding style</strong>. Please follow the <a href="http://adv-r.had.co.nz/Style.html">official ggplot2 style</a>. Maintaining a consistent style across the whole code base makes it much easier to jump into the code. If you’re modifying existing ggplot2 code that doesn’t follow the style guide, a separate pull request to fix the style would be greatly appreciated.</p></li>
<li>
<p>If you’re adding new parameters or a new function, you’ll also need to document them with <a href="https://github.com/klutometis/roxygen">roxygen</a>. Make sure to re-run <code><a href="http://www.rdocumentation.org/packages/devtools/topics/document">devtools::document()</a></code> on the code before submitting.</p>
<p>Currently, ggplot2 uses the development version of roxygen2, which you can get with <code>install_github("klutometis/roxygen")</code>. This will be available on CRAN in the near future.</p>
</li>
</ol>
<!--
1.  If fixing a bug or adding a new feature to a non-graphical function,
    please add a [testthat](https://github.com/hadley/testthat) unit test.

1.  If fixing a bug in the visual output, please add a visual test.
    (Instructions to follow soon)
--><ol>
<li>If you’re adding a new graphical feature, please add a short example to the appropriate function.</li>
</ol>
<p>This seems like a lot of work but don’t worry if your pull request isn’t perfect. It’s a learning process and Winston and I will be on hand to help you out. A pull request is a process, and unless you’ve submitted a few in the past it’s unlikely that your pull request will be accepted as is.</p>
<p>Finally, remember that ggplot2 is a mature package used by thousands of people. This means that it’s extremely difficult (i.e. impossible) to change any existing functionality without breaking someone’s code (or another package on CRAN). Please don’t submit pull requests that change existing behaviour. Instead, think about how you can add a new feature in a minimally invasive way.</p>
</div>
</div>

  </div>

</div>


      <footer>
      <div class="tidyverse">
  <p>ggplot2 is a part of the <strong>tidyverse</strong>, an ecosystem of packages designed with common APIs and a shared philosophy. Learn more at <a href="http://tidyverse.org">tidyverse.org</a>.</p>
</div>

<div class="author">
  <p>Developed by <a href='http://hadley.nz'>Hadley Wickham</a>, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo.</p>
  <p>Site built by <a href="http://pkgdown.r-lib.org">pkgdown</a>.</p>
</div>

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115082821-1"></script>
<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());

 gtag('config', 'UA-115082821-1');
</script>
      </footer>
   </div>

  

  </body>
</html>

About

ggplot2 documentation. Auto-generated from ggplot2 sources by pkgdown

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages