Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' into feature/new-guides-with-gtable

Conflicts:
	NAMESPACE
  • Loading branch information...
commit d3c088421fdf909941fa9a789e60d97a8b766aa8 2 parents c387514 + e9a372d
@kohske kohske authored
Showing with 2,838 additions and 1,818 deletions.
  1. +2 −1  DESCRIPTION
  2. +239 −180 NAMESPACE
  3. +3 −4 R/aes-colour-fill-alpha.r
  4. +2 −3 R/aes-linetype-size-shape.r
  5. +18 −30 R/coord-cartesian-.r
  6. +1 −1  R/ggplot2.r
  7. +1 −1  R/guides-axis.r
  8. +6 −5 R/plot-render.r
  9. +0 −5 R/scale-.r
  10. +5 −6 R/scale-brewer.r
  11. +18 −9 R/scale-continuous.r
  12. +4 −3 R/scale-date.r
  13. +4 −3 R/scale-datetime.r
  14. +4 −1 R/scale-discrete-.r
  15. +4 −10 R/scale-gradient.r
  16. +4 −0 R/scale-gradient2.r
  17. +4 −0 R/scale-gradientn.r
  18. +5 −1 R/scale-grey.r
  19. +4 −1 R/scale-hue.r
  20. +16 −2 R/scale-identity.r
  21. +9 −2 R/scale-linetype.r
  22. +17 −3 R/scale-manual.r
  23. +9 −1 R/scale-shape.r
  24. +7 −4 R/scale-size.r
  25. +5 −3 man/absoluteGrob.Rd
  26. +16 −9 man/aes.Rd
  27. +10 −6 man/aes_all.Rd
  28. +16 −23 man/aes_colour_fill_alpha.Rd
  29. +17 −24 man/aes_linetype_size_shape.Rd
  30. +13 −8 man/aes_string.Rd
  31. +17 −5 man/annotate.Rd
  32. +11 −7 man/benchplot.Rd
  33. +7 −6 man/coord.Rd
  34. +19 −13 man/coord_cartesian.Rd
  35. +10 −7 man/coord_fixed.Rd
  36. +8 −5 man/coord_flip.Rd
  37. +26 −15 man/coord_map.Rd
  38. +26 −17 man/coord_polar.Rd
  39. +17 −12 man/coord_trans.Rd
  40. +18 −8 man/cut_interval.Rd
  41. +16 −7 man/cut_number.Rd
  42. +7 −6 man/cweave.Rd
  43. +5 −4 man/diamonds.Rd
  44. +5 −4 man/economics.Rd
  45. +14 −11 man/expand_limits.Rd
  46. +9 −6 man/facet.Rd
  47. +26 −19 man/facet_grid.Rd
  48. +8 −4 man/facet_null.Rd
  49. +22 −15 man/facet_wrap.Rd
  50. +14 −8 man/fortify.Rd
  51. +33 −26 man/fortify.lm.Rd
  52. +18 −11 man/fortify.map.Rd
  53. +10 −7 man/fortify.sp.Rd
  54. +17 −12 man/geom_abline.Rd
  55. +8 −5 man/geom_area.Rd
  56. +26 −19 man/geom_bar.Rd
  57. +9 −5 man/geom_bin2d.Rd
  58. +9 −6 man/geom_blank.Rd
  59. +23 −15 man/geom_boxplot.Rd
  60. +12 −6 man/geom_contour.Rd
  61. +19 −10 man/geom_crossbar.Rd
  62. +11 −6 man/geom_density.Rd
  63. +14 −8 man/geom_density2d.Rd
  64. +22 −14 man/geom_errorbar.Rd
  65. +17 −11 man/geom_errorbarh.Rd
  66. +14 −8 man/geom_freqpoly.Rd
  67. +8 −4 man/geom_hex.Rd
  68. +13 −10 man/geom_histogram.Rd
  69. +16 −10 man/geom_hline.Rd
  70. +16 −11 man/geom_jitter.Rd
  71. +17 −11 man/geom_line.Rd
  72. +20 −12 man/geom_linerange.Rd
  73. +27 −16 man/geom_path.Rd
  74. +25 −20 man/geom_point.Rd
  75. +16 −9 man/geom_pointrange.Rd
  76. +19 −12 man/geom_polygon.Rd
  77. +9 −6 man/geom_quantile.Rd
  78. +9 −5 man/geom_rect.Rd
  79. +15 −9 man/geom_ribbon.Rd
  80. +9 −5 man/geom_rug.Rd
  81. +19 −12 man/geom_segment.Rd
  82. +10 −6 man/geom_smooth.Rd
  83. +13 −9 man/geom_step.Rd
  84. +14 −10 man/geom_text.Rd
  85. +10 −7 man/geom_tile.Rd
  86. +18 −12 man/geom_vline.Rd
  87. +22 −13 man/ggfluctuation.Rd
  88. +23 −14 man/ggmissing.Rd
  89. +9 −6 man/ggorder.Rd
  90. +18 −10 man/ggpcp.Rd
  91. +10 −8 man/ggplot-add.Rd
  92. +11 −6 man/ggplot.Rd
  93. +18 −9 man/ggplot.data.frame.Rd
  94. +4 −4 man/ggplot2.Rd
  95. +12 −9 man/ggplot_build.Rd
  96. +17 −10 man/ggplot_gtable.Rd
  97. +32 −19 man/ggsave.Rd
  98. +1 −2  man/ggscale.Rd
  99. +11 −6 man/ggstructure.Rd
  100. +28 −18 man/gtable.Rd
  101. +7 −5 man/interleave.Rd
  102. +4 −2 man/is.coord.Rd
  103. +7 −5 man/is.facet.Rd
  104. +11 −6 man/label_both.Rd
  105. +14 −9 man/label_bquote.Rd
  106. +15 −8 man/label_parsed.Rd
  107. +12 −7 man/label_value.Rd
  108. +15 −10 man/labs.Rd
  109. +4 −2 man/last_plot.Rd
  110. +12 −7 man/limits.Rd
  111. +22 −14 man/map_data.Rd
  112. +10 −5 man/mean_se.Rd
  113. +7 −6 man/midwest.Rd
  114. +8 −5 man/movies.Rd
  115. +6 −5 man/mpg.Rd
  116. +8 −7 man/msleep.Rd
  117. +0 −19 man/muted.Rd
  118. +54 −18 man/opts.Rd
  119. +15 −8 man/plotmatrix.Rd
  120. +9 −5 man/position_dodge.Rd
  121. +8 −4 man/position_fill.Rd
  122. +4 −2 man/position_identity.Rd
  123. +16 −11 man/position_jitter.Rd
  124. +8 −4 man/position_stack.Rd
  125. +5 −4 man/presidential.Rd
  126. +13 −6 man/print.ggplot.Rd
  127. +59 −32 man/qplot.Rd
  128. +7 −6 man/rweave.Rd
  129. +17 −10 man/scale_alpha_continuous.Rd
  130. +9 −6 man/scale_alpha_discrete.Rd
  131. +11 −6 man/scale_area.Rd
  132. +13 −7 man/{scale_colour_brewer.Rd → scale_brewer.Rd}
  133. +0 −50 man/scale_colour_gradient2.Rd
  134. +0 −35 man/scale_colour_gradientn.Rd
  135. +0 −26 man/scale_colour_identity.Rd
  136. +37 −16 man/scale_continuous.Rd
  137. +18 −11 man/{scale_x_date.Rd → scale_date.Rd}
  138. +11 −4 man/{scale_x_datetime.Rd → scale_datetime.Rd}
  139. +11 −5 man/{scale_x_discrete.Rd → scale_discrete.Rd}
  140. +24 −11 man/{scale_colour_gradient.Rd → scale_gradient.Rd}
  141. +95 −0 man/scale_gradient2.Rd
  142. +16 −8 man/{scale_colour_grey.Rd → scale_grey.Rd}
  143. +15 −7 man/{scale_colour_hue.Rd → scale_hue.Rd}
  144. +48 −0 man/scale_identity.Rd
  145. +16 −6 man/scale_linetype.Rd
  146. +22 −3 man/{scale_colour_manual.Rd → scale_manual.Rd}
  147. +17 −4 man/scale_shape.Rd
  148. +20 −9 man/{scale_size_continuous.Rd → scale_size.Rd}
  149. +0 −8 man/scale_size_discrete.Rd
  150. +4 −2 man/scale_train.Rd
  151. +8 −5 man/seals.Rd
  152. +11 −7 man/should_stop.Rd
  153. +8 −4 man/stat_abline.Rd
  154. +33 −19 man/stat_bin.Rd
  155. +13 −7 man/stat_bin2d.Rd
  156. +12 −6 man/stat_binhex.Rd
  157. +17 −11 man/stat_boxplot.Rd
  158. +14 −8 man/stat_contour.Rd
  159. +30 −22 man/stat_density.Rd
  160. +22 −15 man/stat_density2d.Rd
  161. +20 −11 man/stat_function.Rd
  162. +8 −4 man/stat_hline.Rd
  163. +8 −4 man/stat_identity.Rd
  164. +24 −12 man/stat_qq.Rd
  165. +25 −13 man/stat_quantile.Rd
  166. +58 −42 man/stat_smooth.Rd
  167. +14 −8 man/stat_spoke.Rd
  168. +17 −9 man/stat_sum.Rd
  169. +31 −24 man/stat_summary.Rd
  170. +9 −5 man/stat_unique.Rd
  171. +8 −4 man/stat_vline.Rd
  172. +7 −3 man/summary.ggplot.Rd
  173. +1 −1  man/theme_blank.Rd
  174. +8 −5 man/theme_bw.Rd
  175. +10 −7 man/theme_grey.Rd
  176. +14 −9 man/theme_line.Rd
  177. +16 −9 man/theme_rect.Rd
  178. +14 −9 man/theme_segment.Rd
  179. +19 −7 man/theme_text.Rd
  180. +13 −10 man/theme_update.Rd
  181. +11 −6 man/update_labels.Rd
  182. +15 −10 man/wrap_hmisc.Rd
  183. +13 −9 man/xlim.Rd
  184. +13 −9 man/ylim.Rd
  185. +1 −1  man/zeroGrob.Rd
View
3  DESCRIPTION
@@ -20,7 +20,8 @@ Imports:
digest,
grid,
reshape2,
- scales
+ scales,
+ memoise
Suggests:
quantreg,
Hmisc,
View
419 NAMESPACE
@@ -1,205 +1,165 @@
-S3method(print, proto)
-S3method(str, uneval)
-S3method(print, uneval)
-S3method("[", uneval)
-S3method(as.character, uneval)
-export(aes)
-export(aes_string)
+export("%+%")
export(aes_all)
+export(aes_string)
+export(aes)
export(annotate)
export(benchplot)
-export(coord)
-export(is.coord)
-S3method(coord_render_bg, default)
-S3method(coord_render_axis_h, default)
-S3method(coord_render_axis_v, default)
+export(continuous_scale)
export(coord_cartesian)
-S3method(is.linear, cartesian)
-S3method(coord_distance, cartesian)
-S3method(coord_transform, cartesian)
-S3method(coord_train, cartesian)
-export(coord_fixed, coord_equal)
-S3method(coord_aspect, fixed)
+export(coord_equal)
+export(coord_fixed)
export(coord_flip)
-S3method(is.linear, flip)
-S3method(coord_transform, flip)
-S3method(coord_train, flip)
-S3method(coord_labels, flip)
export(coord_map)
-S3method(coord_transform, map)
-S3method(coord_distance, map)
-S3method(coord_aspect, map)
-S3method(coord_train, map)
-S3method(coord_render_bg, map)
-S3method(coord_render_axis_h, map)
-S3method(coord_render_axis_v, map)
export(coord_polar)
-S3method(coord_aspect, polar)
-S3method(coord_distance, polar)
-S3method(coord_train, polar)
-S3method(coord_transform, polar)
-S3method(coord_render_axis_v, polar)
-S3method(coord_render_axis_h, polar)
-S3method(coord_render_bg, polar)
-S3method(coord_render_fg, polar)
export(coord_trans)
-S3method(coord_distance, trans)
-S3method(coord_transform, trans)
-S3method(coord_train, trans)
-export(facet)
-export(is.facet)
+export(coord)
+export(cut_interval)
+export(cut_number)
+export(discrete_scale)
+export(expand_limits)
export(facet_grid)
-S3method(facet_train_layout, grid)
-S3method(facet_map_layout, grid)
-S3method(facet_render, grid)
-export(label_value)
-export(label_both)
-export(label_parsed)
-export(label_bquote)
export(facet_null)
-S3method(facet_train_layout, null)
-S3method(facet_map_layout, null)
-S3method(facet_render, null)
export(facet_wrap)
-S3method(facet_train_layout, wrap)
-S3method(facet_map_layout, wrap)
-S3method(facet_render, wrap)
-S3method(fortify, lm)
-S3method(fortify, map)
-export(map_data)
-S3method(fortify, SpatialPolygons)
-S3method(fortify, Polygons)
-S3method(fortify, Polygon)
-S3method(fortify, SpatialLinesDataFrame)
-S3method(fortify, Lines)
-S3method(fortify, Line)
-S3method(fortify, data.frame)
-S3method(fortify, NULL)
-S3method(fortify, default)
+export(facet)
export(fortify)
export(geom_abline)
+export(geom_area)
export(geom_bar)
-export(geom_histogram)
export(geom_bin2d)
export(geom_blank)
export(geom_boxplot)
+export(geom_contour)
export(geom_crossbar)
+export(geom_density)
+export(geom_density2d)
export(geom_errorbar)
export(geom_errorbarh)
export(geom_freqpoly)
export(geom_hex)
+export(geom_histogram)
export(geom_hline)
+export(geom_jitter)
+export(geom_line)
export(geom_linerange)
export(geom_path)
-export(geom_contour)
-export(geom_density2d)
-export(geom_line)
-export(geom_step)
export(geom_point)
-export(geom_jitter)
export(geom_pointrange)
export(geom_polygon)
export(geom_quantile)
export(geom_rect)
export(geom_ribbon)
-export(geom_area)
-export(geom_density)
export(geom_rug)
export(geom_segment)
export(geom_smooth)
+export(geom_step)
export(geom_text)
export(geom_tile)
export(geom_vline)
-import(plyr, digest, scales, grid, reshape2)
-S3method(grobHeight, absoluteGrob)
-S3method(grobWidth, absoluteGrob)
-S3method(grobX, absoluteGrob)
-S3method(grobY, absoluteGrob)
-S3method(grid.draw, absoluteGrob)
-S3method(widthDetails, zeroGrob)
-S3method(heightDetails, zeroGrob)
-S3method(grobWidth, zeroGrob)
-S3method(grobHeight, zeroGrob)
-S3method(drawDetails, zeroGrob)
-export(update_labels)
-export(labs, xlab, ylab)
-export(xlim)
-export(ylim)
-S3method(limits, numeric)
-S3method(limits, character)
-S3method(limits, factor)
-S3method(limits, Date)
-S3method(limits, POSIXct)
-S3method(limits, POSIXlt)
-export(expand_limits)
-export(plotmatrix)
+export(ggfluctuation)
+export(ggmissing)
+export(ggorder)
+export(ggpcp)
export(ggplot_build)
-S3method("+", ggplot)
-export("%+%")
-export(last_plot)
export(ggplot_gtable)
-S3method(print, ggplot)
export(ggplot)
-S3method(ggplot, default)
-S3method(ggplot, data.frame)
+export(ggsave)
+export(ggstructure)
+export(is.coord)
+export(is.facet)
+export(label_both)
+export(label_bquote)
+export(label_parsed)
+export(label_value)
+export(labs)
+export(last_plot)
+export(map_data)
+export(mean_cl_boot)
+export(mean_cl_normal)
+export(mean_sdl)
+export(mean_se)
+export(median_hilow)
+export(opts)
+export(plotmatrix)
export(position_dodge)
export(position_fill)
export(position_jitter)
export(position_stack)
-export(qplot, quickplot)
-export(ggsave)
-S3method(print, scale)
-export(continuous_scale)
-export(discrete_scale)
-S3method(scale_train, continuous)
-S3method(scale_train, discrete)
-S3method(scale_reset, default)
-S3method(scale_transform, continuous)
-S3method(scale_transform, discrete)
-S3method(scale_map, continuous)
-S3method(scale_map, discrete)
-S3method(scale_dimension, continuous)
-S3method(scale_dimension, discrete)
-S3method(scale_breaks, continuous)
-S3method(scale_breaks, discrete)
-S3method(scale_labels, continuous)
-S3method(scale_labels, discrete)
-S3method(scale_clone, continuous)
-S3method(scale_clone, discrete)
-export(scale_alpha, scale_alpha_continuous)
+export(qplot)
+export(quickplot)
+export(scale_alpha_continuous)
export(scale_alpha_discrete)
+export(scale_alpha_identity)
+export(scale_alpha_manual)
+export(scale_alpha)
export(scale_area)
-export(scale_colour_brewer, scale_fill_brewer)
-export(scale_x_continuous, scale_y_continuous, scale_x_log10, scale_y_log10, scale_x_reverse, scale_y_reverse, scale_x_sqrt, scale_y_sqrt)
-S3method(scale_map, position_c)
-export(scale_x_date, scale_y_date)
-export(scale_x_datetime, scale_y_datetime)
-export(scale_x_discrete, scale_y_discrete)
-S3method(scale_train, position_d)
-S3method(scale_limits, position_d)
-S3method(scale_reset, position_d)
-S3method(scale_map, position_d)
-S3method(scale_dimension, position_d)
-export(scale_colour_gradient, scale_fill_gradient)
-export(scale_colour_gradient2, scale_fill_gradient2)
-export(scale_colour_gradientn, scale_fill_gradientn)
-export(scale_colour_grey, scale_fill_grey)
-export(scale_colour_hue, scale_fill_hue)
-export(scale_colour_identity, scale_fill_identity, scale_shape_identity, scale_linetype_identity, scale_alpha_identity, scale_size_identity)
-S3method(scale_map, identity)
-export(scale_linetype, scale_linetype_continuous, scale_linetype_discrete)
-export(scale_colour_manual, scale_fill_manual, scale_shape_manual, scale_linetype_manual, scale_alpha_manual, scale_size_manual)
-export(scale_shape, scale_shape_discrete, scale_shape_continuous)
-export(scale_size, scale_size_continuous)
+export(scale_color_brewer)
+export(scale_color_continuous)
+export(scale_color_discrete)
+export(scale_color_gradient)
+export(scale_color_grey)
+export(scale_color_hue)
+export(scale_color_identity)
+export(scale_color_manual)
+export(scale_colour_brewer)
+export(scale_colour_continuous)
+export(scale_colour_discrete)
+export(scale_colour_gradient)
+export(scale_colour_gradient2)
+export(scale_colour_gradientn)
+export(scale_colour_grey)
+export(scale_colour_hue)
+export(scale_colour_identity)
+export(scale_colour_manual)
+export(scale_fill_brewer)
+export(scale_fill_continuous)
+export(scale_fill_discrete)
+export(scale_fill_gradient)
+export(scale_fill_gradient2)
+export(scale_fill_gradientn)
+export(scale_fill_grey)
+export(scale_fill_hue)
+export(scale_fill_identity)
+export(scale_fill_manual)
+export(scale_linetype_continuous)
+export(scale_linetype_discrete)
+export(scale_linetype_identity)
+export(scale_linetype_manual)
+export(scale_linetype)
+export(scale_shape_continuous)
+export(scale_shape_discrete)
+export(scale_shape_identity)
+export(scale_shape_manual)
+export(scale_shape)
+export(scale_size_continuous)
export(scale_size_discrete)
+export(scale_size_identity)
+export(scale_size_manual)
+export(scale_size)
+export(scale_x_continuous)
+export(scale_x_date)
+export(scale_x_datetime)
+export(scale_x_discrete)
+export(scale_x_log10)
+export(scale_x_reverse)
+export(scale_x_sqrt)
+export(scale_y_continuous)
+export(scale_y_date)
+export(scale_y_datetime)
+export(scale_y_discrete)
+export(scale_y_log10)
+export(scale_y_reverse)
+export(scale_y_sqrt)
+export(should_stop)
+export(stat_abline)
export(stat_bin)
export(stat_bin2d)
export(stat_binhex)
export(stat_boxplot)
export(stat_contour)
-export(stat_density2d)
export(stat_density)
+export(stat_density2d)
export(stat_function)
+export(stat_hline)
export(stat_identity)
export(stat_qq)
export(stat_quantile)
@@ -207,44 +167,143 @@ export(stat_smooth)
export(stat_spoke)
export(stat_sum)
export(stat_summary)
-export(mean_cl_boot, mean_cl_normal, mean_sdl, median_hilow)
-export(mean_se)
export(stat_unique)
-export(stat_abline)
export(stat_vline)
-export(stat_hline)
-S3method(summary, ggplot)
-export(ggpcp)
-export(ggfluctuation)
-export(ggmissing)
-export(ggstructure)
-export(ggorder)
-export(theme_gray, theme_grey)
-export(theme_bw)
export(theme_blank)
-export(theme_rect)
+export(theme_bw)
+export(theme_get)
+export(theme_gray)
+export(theme_grey)
export(theme_line)
+export(theme_rect)
export(theme_segment)
+export(theme_set)
export(theme_text)
-export(theme_update, theme_set, theme_get)
-export(opts)
-S3method(print, theme)
-export(cut_interval)
-export(cut_number)
-S3method(rweave, list)
-S3method(rweave, matrix)
-S3method(cweave, list)
-S3method(cweave, matrix)
-S3method(interleave, list)
-S3method(interleave, unit)
-S3method(interleave, default)
-S3method(print, gtable)
-S3method(dim, gtable)
-S3method(rbind, gtable)
-S3method(cbind, gtable)
-S3method(grid.draw, gtable)
-export(should_stop)
-export(scale_colour_discrete, scale_colour_continuous, scale_fill_discrete, scale_fill_continuous, scale_color_brewer, scale_color_continuous, scale_color_discrete, scale_color_gradient, scale_color_grey, scale_color_hue, scale_color_identity, scale_color_manual, coord_equal)
export(guide_legend)
export(guide_colorbar)
export(guides)
+export(theme_update)
+export(update_labels)
+export(xlab)
+export(xlim)
+export(ylab)
+export(ylim)
+import(digest)
+import(grid)
+import(memoise)
+import(plyr)
+import(reshape2)
+import(scales)
+S3method("[",uneval)
+S3method("+",ggplot)
+S3method(as.character,uneval)
+S3method(cbind,gtable)
+S3method(coord_aspect,fixed)
+S3method(coord_aspect,map)
+S3method(coord_aspect,polar)
+S3method(coord_distance,cartesian)
+S3method(coord_distance,map)
+S3method(coord_distance,polar)
+S3method(coord_distance,trans)
+S3method(coord_labels,flip)
+S3method(coord_render_axis_h,default)
+S3method(coord_render_axis_h,map)
+S3method(coord_render_axis_h,polar)
+S3method(coord_render_axis_v,default)
+S3method(coord_render_axis_v,map)
+S3method(coord_render_axis_v,polar)
+S3method(coord_render_bg,default)
+S3method(coord_render_bg,map)
+S3method(coord_render_bg,polar)
+S3method(coord_render_fg,polar)
+S3method(coord_train,cartesian)
+S3method(coord_train,flip)
+S3method(coord_train,map)
+S3method(coord_train,polar)
+S3method(coord_train,trans)
+S3method(coord_transform,cartesian)
+S3method(coord_transform,flip)
+S3method(coord_transform,map)
+S3method(coord_transform,polar)
+S3method(coord_transform,trans)
+S3method(cweave,list)
+S3method(cweave,matrix)
+S3method(dim,gtable)
+S3method(drawDetails,zeroGrob)
+S3method(facet_map_layout,grid)
+S3method(facet_map_layout,null)
+S3method(facet_map_layout,wrap)
+S3method(facet_render,grid)
+S3method(facet_render,null)
+S3method(facet_render,wrap)
+S3method(facet_train_layout,grid)
+S3method(facet_train_layout,null)
+S3method(facet_train_layout,wrap)
+S3method(fortify,"NULL")
+S3method(fortify,data.frame)
+S3method(fortify,default)
+S3method(fortify,Line)
+S3method(fortify,Lines)
+S3method(fortify,lm)
+S3method(fortify,map)
+S3method(fortify,Polygon)
+S3method(fortify,Polygons)
+S3method(fortify,SpatialLinesDataFrame)
+S3method(fortify,SpatialPolygons)
+S3method(ggplot,data.frame)
+S3method(ggplot,default)
+S3method(grid.draw,absoluteGrob)
+S3method(grid.draw,gtable)
+S3method(grobHeight,absoluteGrob)
+S3method(grobHeight,zeroGrob)
+S3method(grobWidth,absoluteGrob)
+S3method(grobWidth,zeroGrob)
+S3method(grobX,absoluteGrob)
+S3method(grobY,absoluteGrob)
+S3method(heightDetails,zeroGrob)
+S3method(interleave,default)
+S3method(interleave,list)
+S3method(interleave,unit)
+S3method(is.linear,cartesian)
+S3method(is.linear,flip)
+S3method(limits,character)
+S3method(limits,Date)
+S3method(limits,factor)
+S3method(limits,numeric)
+S3method(limits,POSIXct)
+S3method(limits,POSIXlt)
+S3method(print,ggplot)
+S3method(print,gtable)
+S3method(print,proto)
+S3method(print,scale)
+S3method(print,theme)
+S3method(print,uneval)
+S3method(rbind,gtable)
+S3method(rweave,list)
+S3method(rweave,matrix)
+S3method(scale_breaks,continuous)
+S3method(scale_breaks,discrete)
+S3method(scale_clone,continuous)
+S3method(scale_clone,discrete)
+S3method(scale_dimension,continuous)
+S3method(scale_dimension,discrete)
+S3method(scale_dimension,position_d)
+S3method(scale_labels,continuous)
+S3method(scale_labels,discrete)
+S3method(scale_limits,position_d)
+S3method(scale_map,continuous)
+S3method(scale_map,discrete)
+S3method(scale_map,identity)
+S3method(scale_map,position_c)
+S3method(scale_map,position_d)
+S3method(scale_reset,default)
+S3method(scale_reset,position_d)
+S3method(scale_train,continuous)
+S3method(scale_train,discrete)
+S3method(scale_train,position_d)
+S3method(scale_transform,continuous)
+S3method(scale_transform,discrete)
+S3method(str,uneval)
+S3method(summary,ggplot)
+S3method(widthDetails,zeroGrob)
+>>>>>>> develop
View
7 R/aes-colour-fill-alpha.r
@@ -1,11 +1,10 @@
#' Colour related aesthetics: colour, fill and alpha
#'
-#' @name aes_colour_fill_alpha
-#' @aliases colour color fill alpha
-#'
#' This page demonstrates the usage of a sub-group
#' of aesthetics; colour, fill and alpha.
-#'
+#'
+#' @name aes_colour_fill_alpha
+#' @aliases colour color fill alpha
#' @examples
#'
#' # Bar chart example
View
5 R/aes-linetype-size-shape.r
@@ -1,11 +1,10 @@
#' Differentiation related aesthetics: linetype, size, shape
#'
-#' @name aes_linetype_size_shape
-#' @aliases linetype size shape
-#'
#' This page demonstrates the usage of a sub-group
#' of aesthetics; linetype, size and shape.
#'
+#' @name aes_linetype_size_shape
+#' @aliases linetype size shape
#' @examples
#'
#' # Line types should be specified with either an integer, a name, or with a string of
View
48 R/coord-cartesian-.r
@@ -63,42 +63,30 @@ coord_transform.cartesian <- function(., data, details) {
#' @S3method coord_train cartesian
coord_train.cartesian <- function(coord, scales) {
- if (is.null(coord$limits$x)) {
- x.range <- scale_dimension(scales$x)
- } else {
- x.range <- range(scale_transform(scales$x, coord$limits[["x"]]))
- if (coord$wise) {
- scales$x$limits <- x.range
- x.range <- expand_range(x.range,
- scales$x$expand[1], scales$x$expand[2])
- }
- }
-
- x.major <- rescale(scale_break_positions(scales$x), from = x.range)
- x.minor <- rescale(scale_breaks_minor(scales$x), from = x.range)
- x.labels <- scale_labels(scales$x)
+ c(train_cartesian(scales$x, coord$limits$x, "x"),
+ train_cartesian(scales$y, coord$limits$y, "y"))
+}
- if (is.null(coord$limits$y)) {
- y.range <- scale_dimension(scales$y)
+train_cartesian <- memoise(function(scale, limits, name) {
+ if (is.null(limits)) {
+ range <- scale_dimension(scale)
} else {
- y.range <- range(scale_transform(scales$y, coord$limits$y))
-
+ range <- range(scale_transform(scale, limits))
if (coord$wise) {
- scales$y$limits <- y.range
- y.range <- expand_range(y.range,
- scales$y$expand[1], scales$y$expand[2])
+ scale$limits <- x.range
+ range <- expand_range(range, scale$expand[1], scale$expand[2])
}
}
- y.major <- rescale(scale_break_positions(scales$y), from = y.range)
- y.minor <- rescale(scale_breaks_minor(scales$y), from = y.range)
- y.labels <- scale_labels(scales$y)
- list(
- x.range = x.range, y.range = y.range,
- x.major = x.major, x.minor = x.minor, x.labels = x.labels,
- y.major = y.major, y.minor = y.minor, y.labels = y.labels
- )
-}
+ major <- rescale(scale_break_positions(scale), from = range)
+ minor <- rescale(scale_breaks_minor(scale), from = range)
+ labels <- scale_labels(scale)
+
+ out <- list(range = range, major = major, minor = minor, labels = labels)
+ names(out) <- paste(name, names(out), sep = ".")
+ out
+})
+
icon.cartesian <- function(.) {
gTree(children = gList(
View
2  R/ggplot2.r
@@ -3,7 +3,7 @@
#' @name ggplot2
#' @docType package
#' @aliases ggplot2 package-ggplot2
-#' @import plyr digest scales grid reshape2
+#' @import plyr digest scales grid reshape2 memoise
NULL
#' Prices of 50,000 round cut diamonds
View
2  R/guides-axis.r
@@ -87,4 +87,4 @@ guide_axis <- function(at, labels, position="right", theme) {
width = grobWidth(fg),
height = grobHeight(fg)
)
-}
+}
View
11 R/plot-render.r
@@ -102,11 +102,12 @@ ggplot_gtable <- function(plot, data = ggplot_build(plot)) {
plot_table <- gtable_add_grob(plot_table, legend_box,
t = 1, b = 1, l = 2, r = -1)
} else if (position == "manual") {
- legend_vp <- viewport(
- name = "legend_box",
- x = coords[1], y = coords[2], just = theme$legend.justification)
- legend_container <- grobTree(legend_box, childrenvp = legend_vp)
- plot_table <- gtable_add_grob(plot_table, legend_container,
+ legend_box$framevp$x <- unit(coords[1], "npc")
+ legend_box$framevp$y <- unit(coords[2], "npc")
+ legend_vp <- viewport(name = "legend_box",
+ just = theme$legend.justification)
+ legend_container <- grobTree(legend_box, childrenvp = legend_vp)
+ plot_table <- gtable_add_grob(plot_table, legend_container,
t = 2, b = -2, l = 2, r = -1)
}
View
5 R/scale-.r
@@ -22,11 +22,6 @@
#' @S3method print scale
NULL
-#' @paramCopy breaks scales::cbreaks
-#' @paramCopy labels scales::cbreaks
-#' @paramCopy palette scales::cscale
-#' @paramCopy na.value scales::cscale
-#' @paramCopy trans scales::cscale
#' @export
continuous_scale <- function(aesthetics, scale_name, palette, name = NULL, breaks = NULL, labels = NULL, legend = NULL, limits = NULL, rescaler = rescale, oob = censor, expand = c(0, 0), na.value = NA, trans = "identity", guide="legend") {
View
11 R/scale-brewer.r
@@ -2,12 +2,8 @@
#'
#' See \url{http://colorbrewer2.org} for more information.
#'
-#' @paramCopy ... ggplot2::scale_discrete_x
-#' @paramCopy type scales::brewer_pal
-#' @paramCopy palette scales::brewer_pal
-#' @usageFor scale_colour_brewer
-#' @usageFor scale_fill_brewer
-#' @export scale_colour_brewer scale_fill_brewer
+#' @rdname scale_brewer
+#' @export
#' @examples
#' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
#' (d <- qplot(carat, price, data=dsamp, colour=clarity))
@@ -34,6 +30,9 @@
scale_colour_brewer <- function(..., type = "seq", palette = 1) {
discrete_scale("colour", "brewer", brewer_pal(type, palette), ...)
}
+
+#' @export
+#' @rdname scale_brewer
scale_fill_brewer <- function(..., type = "seq", palette = 1) {
discrete_scale("fill", "brewer", brewer_pal(type, palette), ...)
}
View
27 R/scale-continuous.r
@@ -1,17 +1,11 @@
#' Continuous position scales (x & y).
#'
-#' @name scale_continuous
-#' @usageFor scale_x_continuous scale_x_continuous
#' @param ... common continuous scale parameters: \code{name}, \code{breaks},
#' \code{labels}, \code{na.value}, \code{limits} and \code{trans}. See
#' \code{\link{continuous_scale}} for more details
#' @seealso \code{\link{scale_discrete}} for discrete position scales
-#' @aliases scale_x_continuous scale_y_continuous
-#' scale_x_log10 scale_y_log10 scale_x_reverse scale_y_reverse
-#' scale_x_sqrt scale_y_sqrt
-#' @export scale_x_continuous scale_y_continuous
-#' scale_x_log10 scale_y_log10 scale_x_reverse scale_y_reverse
-#' scale_x_sqrt scale_y_sqrt
+#' @rdname scale_continuous
+#' @export
#' @examples
#' (m <- qplot(rating, votes, data=subset(movies, votes > 1000), na.rm = T))
#'
@@ -68,6 +62,8 @@ scale_x_continuous <- function(..., expand = c(0.05, 0)) {
..., expand = expand, guide = "none")
}
+#' @rdname scale_continuous
+#' @export
scale_y_continuous <- function(..., expand = c(0.05, 0)) {
continuous_scale(c("y", "ymin", "ymax", "yend"), "position_c", identity,
..., expand = expand, guide = "none")
@@ -82,22 +78,35 @@ scale_map.position_c <- function(scale, x) {
as.numeric(x)
}
-# Transformed scales
+# Transformed scales ---------------------------------------------------------
+
+#' @rdname scale_continuous
+#' @export
scale_x_log10 <- function(...) {
scale_x_continuous(..., trans = log10_trans())
}
+#' @rdname scale_continuous
+#' @export
scale_y_log10 <- function(...) {
scale_y_continuous(..., trans = log10_trans())
}
+#' @rdname scale_continuous
+#' @export
scale_x_reverse <- function(...) {
scale_x_continuous(..., trans = reverse_trans())
}
+#' @rdname scale_continuous
+#' @export
scale_y_reverse <- function(...) {
scale_y_continuous(..., trans = reverse_trans())
}
+#' @rdname scale_continuous
+#' @export
scale_x_sqrt <- function(...) {
scale_x_continuous(..., trans = sqrt_trans())
}
+#' @rdname scale_continuous
+#' @export
scale_y_sqrt <- function(...) {
scale_y_continuous(..., trans = sqrt_trans())
}
View
7 R/scale-date.r
@@ -1,8 +1,7 @@
#' Position scale, date
#'
-#' @paramCopy ... ggplot2::scale_continuous_x
-#' @usageFor scale_continuous_x scale_continuous_y
-#' @export scale_x_date scale_y_date
+#' @rdname scale_date
+#' @export
#' @examples
#' # We'll start by creating some nonsense data with dates
#' df <- data.frame(
@@ -59,6 +58,8 @@ scale_x_date <- function(..., expand = c(0.05, 0)) {
guide = "none", expand = expand, trans = "date")
}
+#' @rdname scale_date
+#' @export
scale_y_date <- function(..., expand = c(0.05, 0)) {
continuous_scale(c("y", "ymin", "ymax", "yend"), "date", identity, ...,
guide = "none", expand = expand, trans = "date")
View
7 R/scale-datetime.r
@@ -1,8 +1,7 @@
#' Position scale, date
#'
-#' @paramCopy ... ggplot2::scale_continuous_x
-#' @usageFor scale_continuous_x scale_continuous_y
-#' @export scale_x_datetime scale_y_datetime
+#' @rdname scale_datetime
+#' @export
#' @examples
#' start <- ISOdate(2001, 1, 1, tz = "")
#' df <- data.frame(
@@ -45,6 +44,8 @@ scale_map.datetime <- function(scale, x) {
x
}
+#' @rdname scale_datetime
+#' @export
scale_y_datetime <- function(..., expand = c(0.05, 0)) {
continuous_scale(c("y", "ymin", "ymax", "yend"), "datetime", identity, ...,
trans = "time", expand = expand, guide = "none")
View
5 R/scale-discrete-.r
@@ -6,7 +6,8 @@
#' level, and increasing by one for each level (i.e. the labels are placed
#' at integer positions). This is what allows jittering to work.
#'
-#' @export scale_x_discrete scale_y_discrete
+#' @rdname scale_discrete
+#' @export
#' @examples
#' qplot(cut, data=diamonds, stat="bin")
#' qplot(cut, data=diamonds, geom="bar")
@@ -46,6 +47,8 @@ scale_x_discrete <- function(..., expand = c(0, 0.6)) {
sc$range_c <- ContinuousRange$new()
sc
}
+#' @rdname scale_discrete
+#' @export
scale_y_discrete <- function(..., expand = c(0, 0.6)) {
sc <- discrete_scale(c("y", "ymin", "ymax", "yend"), "position_d", identity, ...,
expand = expand, guide = "none")
View
14 R/scale-gradient.r
@@ -2,14 +2,11 @@
#'
#' @param ... Other arguments passed on to \code{\link{continuous_scale}}
#' to control name, limits, breaks, labels and so forth.
-#' @paramCopy low scales::seq_gradient_pal
-#' @paramCopy high scales::seq_gradient_pal
-#' @paramCopy space scales::seq_gradient_pal
-#' @usageFor scale_colour_gradient scale_fill_gradient
#' @param na.value Colour to use for missing values
#' @seealso \code{\link[scales]{seq_gradient_pal}} for details on underlying
#' palette
-#' @export scale_colour_gradient scale_fill_gradient
+#' @rdname scale_gradient
+#' @export
#' @examples
#' # It's hard to see, but look for the bright yellow dot
#' # in the bottom right hand corner
@@ -55,6 +52,8 @@ scale_colour_gradient <- function(..., low = "#3B4FB8", high = "#B71B1A", space
na.value = na.value, ...)
}
+#' @rdname scale_gradient
+#' @export
scale_fill_gradient <- function(..., low = "#3B4FB8", high = "#B71B1A", space = "Lab", na.value = "grey50") {
continuous_scale("fill", "gradient", seq_gradient_pal(low, high, space),
na.value = na.value, ...)
@@ -67,8 +66,3 @@ icon.gradient <- function(.) {
gp=gpar(fill=g$map(1:5), col=NA)
)
}
-
-
-
-
-
View
4 R/scale-gradient2.r
@@ -2,6 +2,8 @@
#'
#' @export scale_colour_gradient2 scale_fill_gradient2
#' @param na.value Colour to use for missing values
+#' @rdname scale_gradient2
+#' @export
#' @examples
#' dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6)
#' dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y))
@@ -46,6 +48,8 @@ scale_colour_gradient2 <- function(..., low = muted("red"), mid = "white", high
rescale = mid_rescaler(mid = midpoint))
}
+#' @rdname scale_gradient2
+#' @export
scale_fill_gradient2 <- function(..., low = muted("red"), mid = "white", high = muted("blue"), midpoint = 0, space = "rgb", na.value = "grey50") {
continuous_scale("fill", "gradient2",
div_gradient_pal(low, mid, high, space), na.value = na.value, ...,
View
4 R/scale-gradientn.r
@@ -2,6 +2,8 @@
#'
#' @export scale_colour_gradientn scale_fill_gradientn
#' @param na.value Colour to use for missing values
+#' @rdname scale_gradient2
+#' @export
#' @examples
#' # scale_colour_gradient make it easy to use existing colour palettes
#'
@@ -30,6 +32,8 @@ scale_colour_gradientn <- function(..., colours, values = NULL, space = "Lab", n
continuous_scale("colour", "gradientn",
gradient_n_pal(colours, values, space), na.value = na.value, ...)
}
+#' @rdname scale_gradient2
+#' @export
scale_fill_gradientn <- function(..., colours, values = NULL, space = "Lab", na.value = "grey50") {
continuous_scale("fill", "gradientn",
gradient_n_pal(colours, values, space), na.value = na.value, ...)
View
6 R/scale-grey.r
@@ -3,7 +3,8 @@
#' Based on \code{\link{gray.colors}}
#'
#' @param na.value Colour to use for missing values
-#' @export scale_colour_grey scale_fill_grey
+#' @rdname scale_grey
+#' @export
#' @examples
#' p <- qplot(mpg, wt, data=mtcars, colour=factor(cyl))
#' p + scale_colour_grey()
@@ -21,6 +22,9 @@ scale_colour_grey <- function(..., start = 0.2, end = 0.8, na.value = "red") {
discrete_scale("colour", "grey", grey_pal(start, end),
na.value = na.value, ...)
}
+
+#' @rdname scale_grey
+#' @export
scale_fill_grey <- function(..., start = 0.2, end = 0.8, na.value = "grey50") {
discrete_scale("fill", "grey", grey_pal(start, end),
na.value = na.value, ...)
View
5 R/scale-hue.r
@@ -1,7 +1,8 @@
#' Qualitative colour scale with evenly spaced hues.
#'
#' @param na.value Colour to use for missing values
-#' @export scale_colour_hue scale_fill_hue
+#' @rdname scale_hue
+#' @export
#' @examples
#' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
#' (d <- qplot(carat, price, data=dsamp, colour=clarity))
@@ -40,6 +41,8 @@ scale_colour_hue <- function(..., h = c(0, 360) + 15, c = 100, l = 65, h.start =
na.value = na.value, ...)
}
+#' @rdname scale_hue
+#' @export
scale_fill_hue <- function(..., h = c(0, 360) + 15, c = 100, l = 65, h.start = 0, direction = 1, na.value = "grey50") {
discrete_scale("fill", "hue", hue_pal(h, c, l, h.start, direction),
na.value = na.value, ...)
View
18 R/scale-identity.r
@@ -1,9 +1,9 @@
#' Use values without scaling.
#'
-#' @export scale_colour_identity scale_fill_identity scale_shape_identity
-#' scale_linetype_identity scale_alpha_identity scale_size_identity
#' @param ... Other arguments passed on to \code{\link{discrete_scale}}
#' @param legend Should this scale have a legend? Defaults to \code{FALSE}
+#' @rdname scale_identity
+#' @export
#' @examples
#' colour <- c("red", "green", "blue", "yellow")
#' qplot(1:4, 1:4, fill = colour, geom = "tile")
@@ -23,23 +23,37 @@ scale_colour_identity <- function(..., legend = FALSE) {
identity_scale(discrete_scale("colour", "identity", identity_pal(), ...,
legend = legend))
}
+
+#' @rdname scale_identity
+#' @export
scale_fill_identity <- function(..., legend = FALSE) {
identity_scale(discrete_scale("fill", "identity", identity_pal(), ...,
legend = legend))
}
+
+#' @rdname scale_identity
+#' @export
scale_shape_identity <- function(..., legend = FALSE) {
identity_scale(discrete_scale("shape", "identity", identity_pal(), ...,
legend = legend))
}
+
+#' @rdname scale_identity
+#' @export
scale_linetype_identity <- function(..., legend = FALSE) {
identity_scale(discrete_scale("linetype", "identity", identity_pal(), ...,
legend = legend))
}
+#' @rdname scale_identity
+#' @export
scale_alpha_identity <- function(..., legend = FALSE) {
identity_scale(continuous_scale("alpha", "identity", identity_pal(), ...,
legend = legend))
}
+
+#' @rdname scale_identity
+#' @export
scale_size_identity <- function(..., legend = FALSE) {
identity_scale(continuous_scale("size", "identity", identity_pal(), ...,
legend = legend))
View
11 R/scale-linetype.r
@@ -1,9 +1,11 @@
#' Scale for line patterns.
#'
#' Default line types based on a set supplied by Richard Pearson,
-#' University of Manchester.
+#' University of Manchester. Line types can not be mapped to continuous
+#' values.
#'
-#' @export scale_linetype scale_linetype_continuous scale_linetype_discrete
+#' @rdname scale_linetype
+#' @export
#' @examples
#' ec_scaled <- data.frame(
#' date = economics$date,
@@ -19,9 +21,14 @@
scale_linetype <- function(...) {
discrete_scale("linetype", "linetype_d", linetype_pal(), ...)
}
+
+#' @rdname scale_linetype
+#' @export
scale_linetype_continuous <- function(...) {
stop("A continuous variable can not be mapped to linetype", call. = FALSE)
}
+#' @rdname scale_linetype
+#' @export
scale_linetype_discrete <- scale_linetype
icon.linetype <- function(.) {
View
20 R/scale-manual.r
@@ -1,7 +1,7 @@
#' Create your own discrete scale.
#'
-#' @export scale_colour_manual scale_fill_manual scale_shape_manual
-#' scale_linetype_manual scale_alpha_manual scale_size_manual
+#' @rdname scale_manual
+#' @export
#' @examples
#' p <- qplot(mpg, wt, data = mtcars, colour = factor(cyl))
#'
@@ -26,21 +26,35 @@
scale_colour_manual <- function(..., values) {
discrete_scale("colour", "manual", manual_pal(values), ...)
}
+
+#' @rdname scale_manual
+#' @export
scale_fill_manual <- function(..., values) {
discrete_scale("fill", "manual", manual_pal(values), ...)
}
+
+#' @rdname scale_manual
+#' @export
scale_size_manual <- function(..., values) {
discrete_scale("size", "manual", manual_pal(values), ...)
}
+
+#' @rdname scale_manual
+#' @export
scale_shape_manual <- function(..., values) {
discrete_scale("shape", "manual", manual_pal(values), ...)
}
+
+#' @rdname scale_manual
+#' @export
scale_linetype_manual <- function(..., values) {
discrete_scale("linetype", "manual", manual_pal(values), ...)
}
+
+#' @rdname scale_manual
+#' @export
scale_alpha_manual <- function(..., values) {
discrete_scale("alpha", "manual", manual_pal(values))
}
icon.manual <- function() textGrob("DIY", gp=gpar(cex=1.2))
-
View
10 R/scale-shape.r
@@ -1,6 +1,9 @@
#' Scale for shapes, aka glyphs.
#'
-#' @export scale_shape scale_shape_discrete scale_shape_continuous
+#' A continuous variable can not be mapped to shape.
+#'
+#' @rdname scale_shape
+#' @export
#' @examples
#' dsmall <- diamonds[sample(nrow(diamonds), 100), ]
#'
@@ -23,7 +26,12 @@ scale_shape <- function(..., solid = TRUE) {
discrete_scale("shape", "shape_d", shape_pal(solid), ...)
}
+#' @rdname scale_shape
+#' @export
scale_shape_discrete <- scale_shape
+
+#' @rdname scale_shape
+#' @export
scale_shape_continuous <- function(...) {
stop("A continuous variable can not be mapped to shape", call. = FALSE)
}
View
11 R/scale-size.r
@@ -1,8 +1,9 @@
-#' Size scale for continuous variables
+#' Size scale.
#'
#' @param range a numeric vector of length 2 that specifies the minimum and
#' maximum size of the plotting symbol after transformation.
-#' @export scale_size scale_size_continuous
+#' @rdname scale_size
+#' @export
#' @examples
#' (p <- qplot(mpg, cyl, data=mtcars, size=cyl))
#' p + scale_size("cylinders")
@@ -26,10 +27,12 @@
scale_size_continuous <- function(..., range = c(1, 6)) {
continuous_scale("size", "size_c", rescale_pal(range), ...)
}
+
+#' @rdname scale_size
+#' @export
scale_size <- scale_size_continuous
-#' Size scale for discrete variables
-#'
+#' @rdname scale_size
#' @export
scale_size_discrete <- function(..., range = c(1, 6)) {
discrete_scale("size", "size_d",
View
8 man/absoluteGrob.Rd
@@ -1,13 +1,15 @@
\name{absoluteGrob}
\alias{absoluteGrob}
\title{Absolute grob...}
-\usage{absoluteGrob(grob, width, height, xmin, ymin)}
-
+\usage{
+ absoluteGrob(grob, width = NULL, height = NULL, xmin =
+ NULL, ymin = NULL)
+}
\description{
Absolute grob This grob has fixed dimesions and position.
}
-
\details{
It's still experimental
}
\keyword{internal}
+
View
25 man/aes.Rd
@@ -1,25 +1,32 @@
\name{aes}
\alias{aes}
\title{Generate aesthetic mappings that describe how variables in the data are...}
-\usage{aes(x, y, ...)}
+\usage{
+ aes(x, y, ...)
+}
+\arguments{
+ \item{x}{x value}
+ \item{y}{y value}
+
+ \item{List}{of name value pairs}
+}
\description{
Generate aesthetic mappings that describe how variables
in the data are mapped to visual properties (aesthetics)
of geoms.
}
-
\details{
\code{aes} creates a list of unevaluated expressions.
This function also performs partial name matching,
converts color to colour, and old style R names to ggplot
names (eg. pch to shape, cex to size)
}
-\seealso{\code{\link{aes_string}}}
-\arguments{
- \item{x}{x value}
- \item{y}{y value}
- \item{List}{of name value pairs}
+\examples{
+aes(x = mpg, y = wt)
+aes(x = mpg ^ 2, y = wt / cyl)
+}
+\seealso{
+ \code{\link{aes_string}}
}
-\examples{aes(x = mpg, y = wt)
-aes(x = mpg ^ 2, y = wt / cyl)}
+
View
16 man/aes_all.Rd
@@ -1,14 +1,18 @@
\name{aes_all}
\alias{aes_all}
\title{Given a character vector, create a set of identity mappings...}
-\usage{aes_all(vars)}
-
+\usage{
+ aes_all(vars)
+}
+\arguments{
+ \item{vars}{vector of variable names}
+}
\description{
Given a character vector, create a set of identity
mappings
}
-\arguments{
- \item{vars}{vector of variable names}
+\examples{
+aes_all(names(mtcars))
+aes_all(c("x", "y", "col", "pch"))
}
-\examples{aes_all(names(mtcars))
-aes_all(c("x", "y", "col", "pch"))}
+
View
39 man/aes_colour_fill_alpha.Rd
@@ -1,28 +1,19 @@
\name{aes_colour_fill_alpha}
+\alias{aes_colour_fill_alpha}
+\alias{alpha}
+\alias{color}
+\alias{colour}
+\alias{fill}
\title{Colour related aesthetics: colour, fill and alpha...}
-
\description{
Colour related aesthetics: colour, fill and alpha
}
-\alias{colour}
-\alias{color}
-\alias{fill}
-\alias{alpha}
-\alias{This}
-\alias{page}
-\alias{demonstrates}
-\alias{the}
-\alias{usage}
-\alias{of}
-\alias{a}
-\alias{sub-group}
-\alias{of}
-\alias{aesthetics;}
-\alias{colour,}
-\alias{fill}
-\alias{and}
-\alias{alpha.}
-\examples{# Bar chart example
+\details{
+ This page demonstrates the usage of a sub-group of
+ aesthetics; colour, fill and alpha.
+}
+\examples{
+# Bar chart example
c <- ggplot(mtcars, aes(factor(cyl)))
# Default plotting
c + geom_bar()
@@ -58,7 +49,7 @@ h + geom_point()
h + geom_point(colour = alpha("black", .5))
h + geom_point(colour = alpha("black", 1/10))
-#If a geom uses both fill and colour, alpha will only modify the fill colour
+#If a geom uses both fill and colour, alpha will only modify the fill colour
c + geom_bar(fill = "dark grey", colour = "black")
c + geom_bar(fill = "dark grey", colour = "black", alpha = 1/3)
@@ -66,7 +57,9 @@ c + geom_bar(fill = "dark grey", colour = "black", alpha = 1/3)
j <- b + geom_line()
j
yrng <- range(economics$unemploy)
-j <- j + geom_rect(aes(NULL, NULL, xmin = start, xmax = end, fill = party),
+j <- j + geom_rect(aes(NULL, NULL, xmin = start, xmax = end, fill = party),
ymin = yrng[1], ymax = yrng[2], data = presidential)
j
-j + scale_fill_manual(values = alpha(c("blue", "red"), .3))}
+j + scale_fill_manual(values = alpha(c("blue", "red"), .3))
+}
+
View
41 man/aes_linetype_size_shape.Rd
@@ -1,27 +1,18 @@
\name{aes_linetype_size_shape}
+\alias{aes_linetype_size_shape}
+\alias{linetype}
+\alias{shape}
+\alias{size}
\title{Differentiation related aesthetics: linetype, size, shape...}
-
\description{
Differentiation related aesthetics: linetype, size, shape
}
-\alias{linetype}
-\alias{size}
-\alias{shape}
-\alias{This}
-\alias{page}
-\alias{demonstrates}
-\alias{the}
-\alias{usage}
-\alias{of}
-\alias{a}
-\alias{sub-group}
-\alias{of}
-\alias{aesthetics;}
-\alias{linetype,}
-\alias{size}
-\alias{and}
-\alias{shape.}
-\examples{# Line types should be specified with either an integer, a name, or with a string of
+\details{
+ This page demonstrates the usage of a sub-group of
+ aesthetics; linetype, size and shape.
+}
+\examples{
+# Line types should be specified with either an integer, a name, or with a string of
# an even number (up to eight) of hexidecimal digits which give the lengths in
# consecutive positions in the string.
# 0 = blank, 1 = solid, 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 = twodash
@@ -31,18 +22,18 @@ df <- data.frame(x = 1:10 , y = 1:10)
f <- ggplot(df, aes(x = x, y = y))
f + geom_line(linetype = 2)
f + geom_line(linetype = "dotdash")
-# An example with hex strings, the string "33" specifies three units on followed
-# by three off and "3313" specifies three units on followed by three off followed
+# An example with hex strings, the string "33" specifies three units on followed
+# by three off and "3313" specifies three units on followed by three off followed
# by one on and finally three off.
f + geom_line(linetype = "3313")
# Mapping line type from a variable
-ec_scaled <- data.frame(date = economics$date, rescaler(economics[, -(1:2)], "range"))
+ec_scaled <- data.frame(date = economics$date, rescaler(economics[, -(1:2)], "range"))
ecm <- melt(ec_scaled, id = "date")
qplot(date, value, data = ecm, geom = "line", linetype = variable)
# Size examples
-# Should be specified with a numerical value (in millimetres),
+# Should be specified with a numerical value (in millimetres),
# or from a variable source
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(size = 4)
@@ -72,4 +63,6 @@ s + geom_point(aes(shape = z), size = 4)
# While all symbols have a foreground colour, symbols 19-25 also take a
# background colour (fill)
s + geom_point(aes(shape = z), size = 4, colour = "Red")
-s + geom_point(aes(shape = z), size = 4, colour = "Red", fill = "Black")}
+s + geom_point(aes(shape = z), size = 4, colour = "Red", fill = "Black")
+}
+
View
21 man/aes_string.Rd
@@ -1,8 +1,12 @@
\name{aes_string}
\alias{aes_string}
\title{Generate aesthetic mappings from a string...}
-\usage{aes_string(...)}
-
+\usage{
+ aes_string(...)
+}
+\arguments{
+ \item{...}{List of name value pairs}
+}
\description{
Generate aesthetic mappings from a string Aesthetic
mappings describe how variables in the data are mapped to
@@ -10,16 +14,17 @@
this function operates on strings rather than
expressions.
}
-
\details{
\code{aes_string} is particularly useful when writing
functions that create plots because you can use strings
to define the aesthetic mappings, rather than having to
mess around with expressions.
}
-\seealso{\code{\link{aes}}}
-\arguments{
- \item{...}{List of name value pairs}
+\examples{
+aes_string(x = "mpg", y = "wt")
+aes(x = mpg, y = wt)
}
-\examples{aes_string(x = "mpg", y = "wt")
-aes(x = mpg, y = wt)}
+\seealso{
+ \code{\link{aes}}
+}
+
View
22 man/annotate.Rd
@@ -1,19 +1,31 @@
\name{annotate}
\alias{annotate}
\title{Annotate a plot...}
-\usage{annotate(geom, x, y, xmin, xmax, ymin, ymax, ...)}
-
-\description{
- Annotate a plot
+\usage{
+ annotate(geom, x = NULL, y = NULL, xmin = NULL, xmax =
+ NULL, ymin = NULL, ymax = NULL, ...)
}
\arguments{
\item{name}{of geom to use for annotation}
+
\item{x}{x position}
+
\item{y}{y position}
+
\item{xmin}{xmin position}
+
\item{ymin}{ymin position}
+
\item{xmax}{xmax position}
+
\item{ymax}{ymax position}
+
\item{...}{other arguments passed to geom as parameters}
}
-\examples{annotate("text", x = 0, y = 0, label = "title")}
+\description{
+ Annotate a plot
+}
+\examples{
+annotate("text", x = 0, y = 0, label = "title")
+}
+
View
18 man/benchplot.Rd
@@ -1,15 +1,19 @@
\name{benchplot}
\alias{benchplot}
\title{Benchmark plot creation time.}
-\usage{benchplot(x)}
-
+\usage{
+ benchplot(x)
+}
+\arguments{
+ \item{x}{code to create ggplot2 plot}
+}
\description{
Benchmark plot creation time. Broken down into construct,
build, render and draw times.
}
-\keyword{internal}
-\arguments{
- \item{x}{code to create ggplot2 plot}
+\examples{
+benchplot(qplot(mpg, wt, data = mtcars))
+benchplot(qplot(mpg, wt, data = mtcars) + facet_grid(.~ cyl))
}
-\examples{benchplot(qplot(mpg, wt, data = mtcars))
-benchplot(qplot(mpg, wt, data = mtcars) + facet_grid(.~ cyl))}
+\keyword{internal}
+
View
13 man/coord.Rd
@@ -1,16 +1,17 @@
\name{coord}
\alias{coord}
\title{New coordinate system.}
-\usage{coord(..., subclass=c())}
-
+\usage{
+ coord(..., subclass = c())
+}
+\arguments{
+ \item{...}{object fields}
+}
\description{
New coordinate system.
}
-
\details{
Internal use only.
}
\keyword{internal}
-\arguments{
- \item{...}{object fields}
-}
+
View
32 man/coord_cartesian.Rd
@@ -1,12 +1,21 @@
\name{coord_cartesian}
\alias{coord_cartesian}
\title{Cartesian coordinates.}
-\usage{coord_cartesian(xlim, ylim, wise=FALSE)}
+\usage{
+ coord_cartesian(xlim = NULL, ylim = NULL, wise = FALSE)
+}
+\arguments{
+ \item{xlim}{limits for the x axis}
+ \item{ylim}{limits for the y axis}
+
+ \item{wise}{If \code{TRUE} will wisely expand the actual
+ range of the plot a little, in the way that setting the
+ limits on the scales does}
+}
\description{
Cartesian coordinates.
}
-
\details{
The Cartesian coordinate system is the most familiar, and
common, type of coordinate system. Setting limits on the
@@ -14,13 +23,8 @@
at it with a magnifying class), and will not change the
underlying data like setting limits on a scale will.
}
-\arguments{
- \item{xlim}{limits for the x axis}
- \item{ylim}{limits for the y axis}
- \item{wise}{If \code{TRUE} will wisely expand the actual range of the plot
-a little, in the way that setting the limits on the scales does}
-}
-\examples{# There are two ways of zooming the plot display: with scales or
+\examples{
+# There are two ways of zooming the plot display: with scales or
# with coordinate systems. They work in two rather different ways.
(p <- qplot(disp, wt, data=mtcars) + geom_smooth())
@@ -32,18 +36,20 @@ p + scale_x_continuous(limits = c(325, 500))
# Setting the limits on the coordinate system performs a visual zoom
# the data is unchanged, and we just view a small portion of the original
-# plot. See how the axis labels are the same as the original data, and
+# plot. See how the axis labels are the same as the original data, and
# the smooth continue past the points visible on this plot.
p + coord_cartesian(xlim = c(325, 500))
# You can see the same thing with this 2d histogram
-(d <- ggplot(diamonds, aes(carat, price)) +
+(d <- ggplot(diamonds, aes(carat, price)) +
stat_bin2d(bins = 25, colour="grey50"))
# When zooming the scale, the we get 25 new bins that are the same
# size on the plot, but represent smaller regions of the data space
d + scale_x_continuous(limits = c(0, 2))
-# When zooming the coordinate system, we see a subset of original 50 bins,
+# When zooming the coordinate system, we see a subset of original 50 bins,
# displayed bigger
-d + coord_cartesian(xlim = c(0, 2))}
+d + coord_cartesian(xlim = c(0, 2))
+}
+
View
17 man/coord_fixed.Rd
@@ -1,12 +1,14 @@
\name{coord_fixed}
+\alias{coord_equal}
+\alias{coord_fixed}
\title{Cartesian coordinates with fixed relationship between x and y scales.}
-\usage{coord_fixed(ratio=1)}
-
+\usage{
+ coord_fixed(ratio = 1)
+}
\description{
Cartesian coordinates with fixed relationship between x
and y scales.
}
-
\details{
A fixed scale coordinate system forces a specified ratio
between the physical representation of data units on the
@@ -19,13 +21,14 @@
\code{\link[MASS]{eqscplot}}, but it works for all types
of graphics.
}
-\alias{coord_fixed}
-\alias{coord_equal}
-\examples{# ensures that the ranges of axes are equal to the specified ratio by
+\examples{
+# ensures that the ranges of axes are equal to the specified ratio by
# adjusting the plot aspect ratio
qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 1)
qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 5)
qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 1/5)
-# Resize the plot to see that the specified aspect ratio is mantained}
+# Resize the plot to see that the specified aspect ratio is mantained
+}
+
View
13 man/coord_flip.Rd
@@ -1,19 +1,20 @@
\name{coord_flip}
\alias{coord_flip}
\title{Flipped cartesian coordinates.}
-\usage{coord_flip(...)}
-
+\usage{
+ coord_flip(...)
+}
\description{
Flipped cartesian coordinates.
}
-
\details{
Flipped cartesian coordinates so that horizontal becomes
vertical, and vertical, horizontal. This is primarily
useful for converting geoms and statistics which display
y conditional on x, to x conditional on y.
}
-\examples{# Very useful for creating boxplots, and other interval
+\examples{
+# Very useful for creating boxplots, and other interval
# geoms in the horizontal instead of vertical position.
qplot(cut, price, data=diamonds, geom="boxplot")
last_plot() + coord_flip()
@@ -28,4 +29,6 @@ h + coord_flip() + scale_x_reverse()
# You can also use it to flip lines and area plots:
qplot(1:5, (1:5)^2, geom="area")
-last_plot() + coord_flip()}
+last_plot() + coord_flip()
+}
+
View
41 man/coord_map.Rd
@@ -1,13 +1,31 @@
\name{coord_map}
\alias{coord_map}
\title{Map projections.}
-\usage{coord_map(projection="mercator", ..., orientation, xlim,
- ylim)}
+\usage{
+ coord_map(projection = "mercator", ..., orientation =
+ NULL, xlim = NULL, ylim = NULL)
+}
+\arguments{
+ \item{projection}{projection to use, see
+ \code{\link{mapproject}} for list}
+
+ \item{...}{other arguments passed on to
+ \code{\link{mapproject}}}
+ \item{orientation}{projection orientation, which defaults
+ to \code{c(90, 0, mean(range(x)))}. This is not optimal
+ for many projections, so you will have to supply your
+ own.}
+
+ \item{xlim}{manually specific x limits (in degrees of
+ lontitude)}
+
+ \item{ylim}{manually specific y limits (in degrees of
+ latitude)}
+}
\description{
Map projections.
}
-
\details{
This coordinate system provides the full range of map
projections available in the mapproj package.
@@ -16,17 +34,8 @@
offer regarding a better (or more correct) way to do
this, please let me know
}
-\arguments{
- \item{projection}{projection to use, see \code{\link{mapproject}} for
-list}
- \item{...}{other arguments passed on to \code{\link{mapproject}}}
- \item{orientation}{projection orientation, which defaults to
-\code{c(90, 0, mean(range(x)))}. This is not optimal for many
-projections, so you will have to supply your own.}
- \item{xlim}{manually specific x limits (in degrees of lontitude)}
- \item{ylim}{manually specific y limits (in degrees of latitude)}
-}
-\examples{if (require("maps")) {
+\examples{
+if (require("maps")) {
# Create a lat-long dataframe from the maps package
nz <- data.frame(map("nz", plot=FALSE)[c("x","y")])
(nzmap <- qplot(x, y, data=nz, geom="path"))
@@ -49,4 +58,6 @@ usamap + coord_map(project="orthographic")
usamap + coord_map(project="stereographic")
usamap + coord_map(project="conic", lat0 = 30)
usamap + coord_map(project="bonne", lat0 = 50)
-}}
+}
+}
+
View
43 man/coord_polar.Rd
@@ -1,31 +1,38 @@
\name{coord_polar}
\alias{coord_polar}
\title{Polar coordinates.}
-\usage{coord_polar(theta="x", start=0, direction=1, expand=FALSE)}
+\usage{
+ coord_polar(theta = "x", start = 0, direction = 1, expand
+ = FALSE)
+}
+\arguments{
+ \item{theta}{variable to map angle to (\code{x} or
+ \code{y})}
+
+ \item{start}{offset of starting point from 12 o'clock in
+ radians}
+ \item{direction}{1, clockwise; -1, anticlockwise}
+
+ \item{should}{axes be expanded to slightly outside the
+ range of the data? (default: FALSE)}
+}
\description{
Polar coordinates.
}
-
\details{
The polar coordinate system is most commonly used for pie
charts, which are a stacked bar chart in polar
coordinates.
}
-\arguments{
- \item{theta}{variable to map angle to (\code{x} or \code{y})}
- \item{start}{offset of starting point from 12 o'clock in radians}
- \item{direction}{1, clockwise; -1, anticlockwise}
- \item{should}{axes be expanded to slightly outside the range of the data?
-(default: FALSE)}
-}
-\examples{# NOTE: Use these plots with caution - polar coordinates has
-# major perceptual problems. The main point of these examples is
+\examples{
+# NOTE: Use these plots with caution - polar coordinates has
+# major perceptual problems. The main point of these examples is
# to demonstrate how these common plots can be described in the
# grammar. Use with EXTREME caution.
# A coxcomb plot = bar chart + polar coordinates
-cxc <- ggplot(mtcars, aes(x = factor(cyl))) +
+cxc <- ggplot(mtcars, aes(x = factor(cyl))) +
geom_bar(width = 1, colour = "black")
cxc + coord_polar()
# A new type of plot?
@@ -44,10 +51,10 @@ df <- data.frame(
variable = c("resembles", "does not resemble"),
value = c(80, 20)
)
-ggplot(df, aes(x = "", y = value, fill = variable)) +
-geom_bar(width = 1) +
-scale_fill_manual(values = c("red", "yellow")) +
-coord_polar("y", start=pi / 3) +
+ggplot(df, aes(x = "", y = value, fill = variable)) +
+geom_bar(width = 1) +
+scale_fill_manual(values = c("red", "yellow")) +
+coord_polar("y", start=pi / 3) +
opts(title = "Pac man")
# Windrose + doughnut plot
@@ -59,4 +66,6 @@ doh <- ggplot(movies, aes(x = rrating, fill = budgetq))
# Wind rose
doh + geom_bar(width = 1) + coord_polar()
# Race track plot
-doh + geom_bar(width = 0.9, position = "fill") + coord_polar(theta = "y")}
+doh + geom_bar(width = 0.9, position = "fill") + coord_polar(theta = "y")
+}
+
View
29 man/coord_trans.Rd
@@ -1,16 +1,19 @@
\name{coord_trans}
\alias{coord_trans}
\title{Transformed cartesian coordinate system.}
-\usage{coord_trans(xtrans="identity", ytrans="identity")}
-
-\description{
- Transformed cartesian coordinate system.
+\usage{
+ coord_trans(xtrans = "identity", ytrans = "identity")
}
\arguments{
\item{ytrans}{transformer for x axis}
+
\item{xtrans}{transformer for y axis}
}
-\examples{# See ?geom_boxplot for other examples
+\description{
+ Transformed cartesian coordinate system.
+}
+\examples{
+# See ?geom_boxplot for other examples
# Three ways of doing transformating in ggplot:
# * by transforming the data
@@ -24,13 +27,13 @@ qplot(carat, price, data=diamonds) + coord_trans(x = "log10", y = "log10")
# The difference between transforming the scales and
# transforming the coordinate system is that scale
# transformation occurs BEFORE statistics, and coordinate
-# transformation afterwards. Coordinate transformation also
+# transformation afterwards. Coordinate transformation also
# changes the shape of geoms:
d <- subset(diamonds, carat > 0.5)
-qplot(carat, price, data = d, log="xy") +
+qplot(carat, price, data = d, log="xy") +
geom_smooth(method="lm")
-qplot(carat, price, data = d) +
+qplot(carat, price, data = d) +
geom_smooth(method="lm") +
coord_trans(x = "log10", y = "log10")
@@ -41,16 +44,18 @@ coord_trans(x = "log10", y = "log10")
# With a combination of scale and coordinate transformation, it's
# possible to do back-transformations:
library(scales)
-qplot(carat, price, data=diamonds, log="xy") +
-geom_smooth(method="lm") +
+qplot(carat, price, data=diamonds, log="xy") +
+geom_smooth(method="lm") +
coord_trans(x = exp_trans(10), y = exp_trans(10))
# cf.
qplot(carat, price, data=diamonds) + geom_smooth(method = "lm")
# Also works with discrete scales
df <- data.frame(a = abs(rnorm(26)),letters)
-plot <- ggplot(df,aes(a,letters)) + geom_point()
+plot <- ggplot(df,aes(a,letters)) + geom_point()
plot + coord_trans(x = "log10")
plot + coord_trans(x = "sqrt")
-plot + coord_trans(x = "sqrt", y = "reverse")}
+plot + coord_trans(x = "sqrt", y = "reverse")
+}
+
View
26 man/cut_interval.Rd
@@ -1,18 +1,28 @@
\name{cut_interval}
\alias{cut_interval}
\title{Cut numeric vector into intervals of equal length.}
-\usage{cut_interval(x, n, length, ...)}
-
-\description{
- Cut numeric vector into intervals of equal length.
+\usage{
+ cut_interval(x, n = NULL, length = NULL, ...)
}
-\seealso{\code{\link{cut_number}}}