Skip to content

Commit 5e7fe1e

Browse files
committed
Merge branch 'hadley-master'
2 parents c2b7e0c + e789d26 commit 5e7fe1e

File tree

197 files changed

+9745
-20127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+9745
-20127
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ visual_test
99
^data-raw$
1010
^CONTRIBUTING\.md$
1111
^NEWS$
12-
^NEWS\.md$
1312
^revdep$
13+
^\.httr-oauth$

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.Rhistory
33
.RData
44
inst/doc
5+
.httr-oauth
6+
.*.Rnb.cached

.travis.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
language: R
2-
sudo: required
3-
warnings_are_errors: true
4-
5-
r_packages:
6-
- rmarkdown
2+
cache: packages
3+
sudo: false
74

85
r_github_packages:
96
- hadley/staticdocs
10-
- jimhester/covr
11-
12-
before_script:
13-
- sudo Rscript -e "library(stringi); stri_install_icudt()"
147

158
after_success:
169
- Rscript -e 'covr::codecov()'
1710

1811
before_deploy:
12+
- R -e "install.packages('roxygen2', repos = 'http://cran.rstudio.com')"
1913
- R -e "staticdocs::build_site(examples = TRUE)"
2014

2115
deploy:

DESCRIPTION

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: ggplot2
2-
Version: 2.0.0.9001
2+
Version: 2.1.0
33
Authors@R: c(
44
person("Hadley", "Wickham", , "[email protected]", c("aut", "cre")),
55
person("Winston", "Chang", , "[email protected]", "aut"),
@@ -25,18 +25,23 @@ Imports:
2525
scales (>= 0.3.0),
2626
stats
2727
Suggests:
28+
covr,
2829
ggplot2movies,
2930
hexbin,
3031
Hmisc,
32+
lattice,
3133
mapproj,
3234
maps,
3335
maptools,
3436
mgcv,
3537
multcomp,
3638
nlme,
37-
testthat,
39+
testthat (>= 0.11.0),
3840
quantreg,
39-
knitr
41+
knitr,
42+
rpart,
43+
rmarkdown,
44+
svglite
4045
Enhances: sp
4146
License: GPL-2
4247
URL: http://ggplot2.org, https://github.com/hadley/ggplot2
@@ -64,6 +69,7 @@ Collate:
6469
'annotation.r'
6570
'autoplot.r'
6671
'bench.r'
72+
'bin.R'
6773
'coord-.r'
6874
'coord-cartesian-.r'
6975
'coord-fixed.r'
@@ -134,6 +140,7 @@ Collate:
134140
'guides-.r'
135141
'guides-axis.r'
136142
'guides-grid.r'
143+
'hexbin.R'
137144
'labels.r'
138145
'layer.r'
139146
'limits.r'
@@ -169,6 +176,7 @@ Collate:
169176
'scale-manual.r'
170177
'scale-shape.r'
171178
'scale-size.r'
179+
'scale-type.R'
172180
'scales-.r'
173181
'stat-bin.r'
174182
'stat-bin2d.r'
@@ -198,7 +206,6 @@ Collate:
198206
'theme-defaults.r'
199207
'theme-elements.r'
200208
'theme.r'
201-
'translate-qplot-base.r'
202209
'translate-qplot-ggplot.r'
203210
'translate-qplot-lattice.r'
204211
'utilities-break.r'
@@ -210,4 +217,4 @@ Collate:
210217
'zxx.r'
211218
'zzz.r'
212219
VignetteBuilder: knitr
213-
RoxygenNote: 5.0.0
220+
RoxygenNote: 5.0.1

NAMESPACE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ S3method(format,facet)
3636
S3method(format,ggproto)
3737
S3method(format,ggproto_method)
3838
S3method(fortify,"NULL")
39+
S3method(fortify,"function")
3940
S3method(fortify,Line)
4041
S3method(fortify,Lines)
4142
S3method(fortify,Polygon)
@@ -90,18 +91,21 @@ S3method(predictdf,loess)
9091
S3method(print,element)
9192
S3method(print,facet)
9293
S3method(print,ggplot)
94+
S3method(print,ggplot2_bins)
9395
S3method(print,ggproto)
9496
S3method(print,ggproto_method)
9597
S3method(print,rel)
9698
S3method(print,theme)
9799
S3method(print,uneval)
100+
S3method(scale_type,AsIs)
98101
S3method(scale_type,Date)
99102
S3method(scale_type,POSIXt)
100103
S3method(scale_type,character)
101104
S3method(scale_type,default)
102105
S3method(scale_type,factor)
103106
S3method(scale_type,logical)
104107
S3method(scale_type,numeric)
108+
S3method(scale_type,ordered)
105109
S3method(str,uneval)
106110
S3method(summary,ggplot)
107111
S3method(widthDetails,stripGrob)
@@ -371,6 +375,8 @@ export(scale_color_identity)
371375
export(scale_color_manual)
372376
export(scale_colour_brewer)
373377
export(scale_colour_continuous)
378+
export(scale_colour_date)
379+
export(scale_colour_datetime)
374380
export(scale_colour_discrete)
375381
export(scale_colour_distiller)
376382
export(scale_colour_gradient)
@@ -382,6 +388,8 @@ export(scale_colour_identity)
382388
export(scale_colour_manual)
383389
export(scale_fill_brewer)
384390
export(scale_fill_continuous)
391+
export(scale_fill_date)
392+
export(scale_fill_datetime)
385393
export(scale_fill_discrete)
386394
export(scale_fill_distiller)
387395
export(scale_fill_gradient)
@@ -405,6 +413,8 @@ export(scale_shape_manual)
405413
export(scale_size)
406414
export(scale_size_area)
407415
export(scale_size_continuous)
416+
export(scale_size_date)
417+
export(scale_size_datetime)
408418
export(scale_size_discrete)
409419
export(scale_size_identity)
410420
export(scale_size_manual)
@@ -460,6 +470,7 @@ export(theme_grey)
460470
export(theme_light)
461471
export(theme_linedraw)
462472
export(theme_minimal)
473+
export(theme_replace)
463474
export(theme_set)
464475
export(theme_update)
465476
export(theme_void)

NEWS.md

Lines changed: 139 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,146 @@
1-
# ggplot2 2.0.0.9000
1+
# ggplot2 2.1.0.9000
22

3-
## Bug fixes and minor improvements
3+
* `x` and `y` scales are now symmetric regarding the list of
4+
aesthetics they accept: `xmin_final`, `xmax_final`, `xlower`,
5+
`xmiddle` and `xupper` are now valid `x` aesthetics.
46

5-
* Fixed a compatibility issue with `ggproto` and R versions prior to 3.1.2.
6-
(#1444)
7+
* `ggtitle()` and `labs()` take a `subtitle` parameter which makes it
8+
possible to add a subtitle below the main plot title. (@hrbrmstr)
9+
10+
* `labs()` takes a `caption` parameter that will set the label for
11+
the annotation text below the plot panels. (@JanSchulz)
12+
13+
* The main plot title and subtitle are left-justified (`hjust = 0`) by
14+
default. The `caption` annotation below the plot will be right-justified
15+
by default. (@hrbrmstr)
16+
17+
* Minor code formatting issues in examples and function parameters were
18+
fixed. (@hrbrmstr)
19+
20+
# ggplot2 2.1.0
21+
22+
## New features
23+
24+
* When mapping an aesthetic to a constant (e.g.
25+
`geom_smooth(aes(colour = "loess")))`), the default guide title is the name
26+
of the aesthetic (i.e. "colour"), not the value (i.e. "loess") (#1431).
27+
28+
* `layer()` now accepts a function as the data argument. The function will be
29+
applied to the data passed to the `ggplot()` function and must return a
30+
data.frame (#1527, @thomasp85). This is a more general version of the
31+
deprecated `subset` argument.
32+
33+
* `theme_update()` now uses the `+` operator instead of `%+replace%`, so that
34+
unspecified values will no longer be `NULL`ed out. `theme_replace()`
35+
preserves the old behaviour if desired (@oneillkza, #1519).
36+
37+
* `stat_bin()` has been overhauled to use the same algorithm as ggvis, which
38+
has been considerably improved thanks to the advice of Randy Prium (@rpruim).
39+
This includes:
40+
41+
* Better arguments and a better algorithm for determining the origin.
42+
You can now specify either `boundary` or the `center` of a bin.
43+
`origin` has been deprecated in favour of these arguments.
44+
45+
* `drop` is deprecated in favour of `pad`, which adds extra 0-count bins
46+
at either end (needed for frequency polygons). `geom_histogram()` defaults
47+
to `pad = FALSE` which considerably improves the default limits for
48+
the histogram, especially when the bins are big (#1477).
49+
50+
* The default algorithm does a (somewhat) better job at picking nice widths
51+
and origins across a wider range of input data.
52+
53+
* `bins = n` now gives a histogram with `n` bins, not `n + 1` (#1487).
54+
55+
## Bug fixes
56+
57+
* All `\donttest{}` examples run.
58+
59+
* All `geom_()` and `stat_()` functions now have consistent argument order:
60+
data + mapping, then geom/stat/position, then `...`, then specific arguments,
61+
then arguments common to all layers (#1305). This may break code if you were
62+
previously relying on partial name matching, but in the long-term should make
63+
ggplot2 easier to use. In particular, you can now set the `n` parameter
64+
in `geom_density2d()` without it partially matching `na.rm` (#1485).
65+
66+
* For geoms with both `colour` and `fill`, `alpha` once again only affects
67+
fill (Reverts #1371, #1523). This was causing problems for people.
68+
69+
* `facet_wrap()`/`facet_grid()` works with multiple empty panels of data
70+
(#1445).
71+
72+
* `facet_wrap()` correctly swaps `nrow` and `ncol` when facetting vertically
73+
(#1417).
74+
75+
* `ggsave("x.svg")` now uses svglite to produce the svg (#1432).
776

8-
* `stat-density-2d()` no longer ignores the `h` parameter.
77+
* `geom_boxplot()` now understands `outlier.color` (#1455).
978

10-
* `stat-density-2d()` now accepts `bins` and `binwidth` parameters
11-
to control the number of contour levels (#1448, @has2k1).
79+
* `geom_path()` knows that "solid" (not just 1) represents a solid line (#1534).
80+
81+
* `geom_ribbon()` preserves missing values so they correctly generate a
82+
gap in the ribbon (#1549).
83+
84+
* `geom_tile()` once again accepts `width` and `height` parameters (#1513).
85+
It uses `draw_key_polygon()` for better a legend, including a coloured
86+
outline (#1484).
87+
88+
* `layer()` now automatically adds a `na.rm` parameter if none is explicitly
89+
supplied.
90+
91+
* `position_jitterdodge()` now works on all possible dodge aesthetics,
92+
e.g. `color`, `linetype` etc. instead of only based on `fill` (@bleutner)
93+
94+
* `position = "nudge"` now works (although it doesn't do anything useful)
95+
(#1428).
96+
97+
* The default scale for columns of class "AsIs" is now "identity" (#1518).
98+
99+
* `scale_*_discrete()` has better defaults when used with purely continuous
100+
data (#1542).
101+
102+
* `scale_size()` warns when used with categorical data.
103+
104+
* `scale_size()`, `scale_colour()`, and `scale_fill()` gain date and date-time
105+
variants (#1526).
106+
107+
* `stat_bin_hex()` and `stat_bin_summary()` now use the same underlying
108+
algorithm so results are consistent (#1383). `stat_bin_hex()` now accepts
109+
a `weight` aesthetic. To be consistent with related stats, the output variable
110+
from `stat_bin_hex()` is now value instead of count.
111+
112+
* `stat_density()` gains a `bw` parameter which makes it easy to get consistent
113+
smoothing between facets (@jiho)
114+
115+
* `stat-density-2d()` no longer ignores the `h` parameter, and now accepts
116+
`bins` and `binwidth` parameters to control the number of contours
117+
(#1448, @has2k1).
118+
119+
* `stat_ecdf()` does a better job of adding padding to -Inf/Inf, and gains
120+
an argument `pad` to suppress the padding if not needed (#1467).
121+
122+
* `stat_function()` gains an `xlim` parameter (#1528). It once again works
123+
with discrete x values (#1509).
124+
125+
* `stat_summary()` preserves sorted x order which avoids artefacts when
126+
display results with `geom_smooth()` (#1520).
127+
128+
* All elements should now inherit correctly for all themes except `theme_void()`.
129+
(@Katiedaisey, #1555)
130+
131+
* `theme_void()` was completely void of text but facets and legends still
132+
need labels. They are now visible (@jiho).
133+
134+
* You can once again set legend key and height width to unit arithmetic
135+
objects (like `2 * unit(1, "cm")`) (#1437).
136+
137+
* Eliminate spurious warning if you have a layer with no data and no aesthetics
138+
(#1451).
139+
140+
* Removed a superfluous comma in `theme-defaults.r` code (@jschoeley)
141+
142+
* Fixed a compatibility issue with `ggproto` and R versions prior to 3.1.2.
143+
(#1444)
12144

13145
# ggplot2 2.0.0
14146

R/aes.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ is_position_aes <- function(vars) {
112112
#' evaluation to capture the variable names. \code{aes_} and \code{aes_string}
113113
#' require you to explicitly quote the inputs either with \code{""} for
114114
#' \code{aes_string()}, or with \code{quote} or \code{~} for \code{aes_()}.
115-
#' (\code{aes_q} is an alias to \code{aeq_})
115+
#' (\code{aes_q} is an alias to \code{aes_})
116116
#'
117117
#' It's better to use \code{aes_q()}, because there's no easy way to create the
118118
#' equivalent to \code{aes(colour = "my colour")} or \code{aes{x = `X$1`}}

R/annotation-custom.r

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@ NULL
2626
#' base <- ggplot(df, aes(x, y)) +
2727
#' geom_blank() +
2828
#' theme_bw()
29-
#' # Adding a table
30-
#' \dontrun{
31-
#' if (require(gridExtra)) {
32-
#' base + annotation_custom(grob = tableGrob(head(iris[ ,1:3])),
33-
#' xmin = 3, xmax = 6, ymin = 2, ymax = 8)
34-
#' # full panel
35-
#' base + annotation_custom(grob = roundrectGrob(),
36-
#' xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)
37-
#' }
38-
#' }
29+
#'
30+
#' # Full panel annotation
31+
#' base + annotation_custom(
32+
#' grob = grid::roundrectGrob(),
33+
#' xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf
34+
#' )
35+
#'
3936
#' # Inset plot
4037
#' df2 <- data.frame(x = 1 , y = 1)
4138
#' g <- ggplotGrob(ggplot(df2, aes(x, y)) +

R/annotation.r

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#' @param geom name of geom to use for annotation
1515
#' @param x,y,xmin,ymin,xmax,ymax,xend,yend positioning aesthetics -
1616
#' you must specify at least one of these.
17-
#' @param ... other aesthetics. These are not scaled so you can do (e.g.)
18-
#' \code{colour = "red"} to get a red point.
17+
#' @inheritParams layer
1918
#' @inheritParams geom_point
2019
#' @export
2120
#' @examples

0 commit comments

Comments
 (0)