Skip to content

Commit

Permalink
preparing for CRAN submission, v 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Nov 16, 2017
1 parent ed2b5ba commit 7bd1f97
Show file tree
Hide file tree
Showing 16 changed files with 295 additions and 105 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cowplot
Title: Streamlined Plot Theme and Plot Annotations for 'ggplot2'
Version: 0.8.0.9000
Version: 0.9.0
Authors@R: c( person("Claus O.", "Wilke", role = c("aut", "cre"), email =
"wilke@austin.utexas.edu"), person("RStudio", role = c("cph"), comment = "Copyright for ggplot2 code copied to cowplot" ))
Description: Some helpful extensions and modifications to the 'ggplot2'
Expand All @@ -25,11 +25,10 @@ License: GPL-2
LazyData: true
Suggests:
covr,
ggjoy,
ggstance,
gridGraphics,
knitr,
magick,
maps,
dplyr,
tidyr,
testthat,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export(plot_grid)
export(plot_to_gtable)
export(save_plot)
export(theme_cowplot)
export(theme_map)
export(theme_nothing)
import(ggplot2)
importFrom(ggplot2,GeomCustomAnn)
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cowplot 0.8.0.9000
cowplot 0.9.0
----------------------------------------------------------------
- Added a theme for maps, `theme_map()`. Code provided by Spencer Fox, https://github.com/sjfox.
- Added `axis_canvas()` function and related functions to make
marginal plots and plot annotations simpler
- Now export the `plot_to_gtable` function which converts most
Expand Down
17 changes: 8 additions & 9 deletions R/draw.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' Draw a line from connected points
#'
#' Provide a sequence of x values and accompanying y values to draw a line on a plot.
#'
#'
#' This is a convenience function, providing a wrapper around ggplot2's \code{geom_path}.
#'
#' @param x Vector of x coordinates.
Expand Down Expand Up @@ -37,9 +37,9 @@ draw_line <- function(x, y, ...){
#' By default, the x and y coordinates specify the center of the text box. Set \code{hjust = 0, vjust = 0} to specify
#' the lower left corner, and other values of \code{hjust} and \code{vjust} for any other relative location you want to
#' specify.
#'
#'
#' For a full list of ... options, see \code{\link{geom_label}}.
#'
#'
#' @param text A vector of Character (not expressions) specifying the string(s) to be written.
#' @param x Vector of x coordinates.
#' @param y Vector of y coordinates.
Expand All @@ -62,7 +62,7 @@ draw_text <- function(text, x = 0.5, y = 0.5, size = 14, hjust = 0.5, vjust = 0.
aes(x = x, y = y, label = text),
size = (size / .pt), # scale font size to match size in theme definition
inherit.aes = FALSE,
hjust = hjust,
hjust = hjust,
vjust = vjust,
...)
}
Expand Down Expand Up @@ -96,16 +96,16 @@ draw_text <- function(text, x = 0.5, y = 0.5, size = 14, hjust = 0.5, vjust = 0.
#' c <- cor.test(mtcars$mpg, mtcars$disp, method = 'sp')
#' label <- substitute(paste("Spearman ", rho, " = ", estimate, ", P = ", pvalue),
#' list(estimate = signif(c$estimate, 2), pvalue = signif(c$p.value, 2)))
#'
#'
#' # Add label to plot, centered on {x,y} (in data coordinates)
#' p + draw_label(label, x = 20, y = 400)
#' # Add label to plot in data coordinates, flush-left at x, baseline at y.
#' p + draw_label(label, x = 20, y = 400, hjust = 0, vjust = 0)
#'
#' # Add label to plot. Data coordinates, drawing rightward
#' # Add label to plot. Data coordinates, drawing rightward
#' # from x, with ascenders of text touching y.
#' p + draw_label(label, x = 20, y = 400, hjust = 0, vjust = 1)
#'
#'
#' # Add labels via ggdraw. Uses ggdraw coordinates.
#' # ggdraw coordinates default to xlim = c(0, 1), ylim = c(0, 1).
#' ggdraw(p) + draw_label("centered on 70% of x, 90% of y height", x = 0.7, y = 0.9)
Expand Down Expand Up @@ -252,8 +252,7 @@ draw_figure_label <- function(label, position = c("top.left", "top", "top.right"
#' # Manipulate images and draw in plot coordinates
#' img <- magick::image_read("http://jeroen.github.io/images/tiger.svg")
#' img <- magick::image_transparent(img, color = "white")
#' img2 <- magick::image_charcoal(img)
#' img2 <- magick::image_transparent(img2, color = "white")
#' img2 <- magick::image_negate(img)
#' ggplot(data.frame(x = 1:3, y = 1:3), aes(x, y)) +
#' geom_point(size = 3) +
#' geom_abline(slope = 1, intercept = 0, linetype = 2, color = "blue") +
Expand Down
3 changes: 2 additions & 1 deletion R/themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ theme_nothing <- function(base_size = 14, base_family = ""){
#' usa_data = map_data("usa")
#' ggplot(usa_data, aes(long, lat, group=region)) + geom_polygon() + theme_map()
#' ggplot(usa_data, aes(long, lat, fill = region)) + geom_polygon() + theme_map()
#' ggplot(usa_data, aes(long, lat, fill = region)) + facet_wrap(~region, scales = "free") + geom_polygon() + theme_map()
#' ggplot(usa_data, aes(long, lat, fill = region)) + facet_wrap(~region, scales = "free") +
#' geom_polygon() + theme_map()
#' @export
theme_map <- function(base_size = 14, base_family = ""){
# work based off of theme_void
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cowplot – An add-on to the ggplot2 plotting package
[![Build Status](https://travis-ci.org/wilkelab/cowplot.svg?branch=master)](https://travis-ci.org/wilkelab/cowplot)
[![Coverage Status](https://img.shields.io/codecov/c/github/wilkelab/cowplot/master.svg)](https://codecov.io/github/wilkelab/cowplot?branch=master)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/cowplot)](https://CRAN.R-project.org/package=cowplot)
[![CRAN\_Downloads\_Badge](http://cranlogs.r-pkg.org/badges/grand-total/cowplot?color=brightgreen)](http://cranlogs.r-pkg.org/downloads/total/last-month/cowplot)
[![CRAN\_Downloads\_Badge](http://cranlogs.r-pkg.org/badges/cowplot)](http://cranlogs.r-pkg.org/downloads/total/last-month/cowplot)

The cowplot package is meant to provide a publication-ready theme for ggplot2, one that requires a minimum amount of fiddling with sizes of axis labels, plot backgrounds, etc. It meets my personal needs; you may or may not like my style.

Expand Down
30 changes: 19 additions & 11 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This is a major improvement that fixes numerous bugs and adds two substantial new features.

## Test environments
* R devel and R 3.4.1 on win-builder [ via devtools::build_win() ]
* local OS X install x86_64-apple-darwin15.6.0 (64-bit), R 3.4.1
* R devel and R 3.4.2 on win-builder [ via devtools::build_win() ]
* local OS X install x86_64-apple-darwin15.6.0 (64-bit), R 3.4.2

## R CMD check results
There were no ERRORs or WARNINGs.
Expand All @@ -16,25 +16,33 @@ Both spellings are correct.

## Downstream dependencies
Seem fine, according to devtools::revdep_check().
The two packages with errors failed at the installation stage,
The packages with errors failed at the installation stage,
not because of cowplot.

Full results available at https://github.com/wilkelab/cowplot/blob/master/revdep/README.md

13 packages
21 packages

|package |version | errors| warnings| notes|
|:------------|:-------|------:|--------:|-----:|
|bigstatsr |0.2.2 | 1| 0| 0|
|deconvolveR |1.0-3 | 0| 0| 0|
|DGCA |1.0.1 | 1| 0| 0|
|ggjoy |0.2.0 | 0| 0| 0|
|ggpubr |0.1.4 | 0| 0| 0|
|ggpubr |0.1.6 | 0| 0| 1|
|IncucyteDRC |0.5.4 | 0| 0| 0|
|jtools |0.4.5 | 0| 0| 1|
|jtools |0.9.0 | 0| 0| 1|
|JWileymisc |0.2.1 | 0| 0| 0|
|meme |0.0.7 | 0| 0| 0|
|memery |0.3.1 | 0| 0| 0|
|modcmfitr |0.1.0 | 0| 0| 0|
|oddsratio |1.0.0 | 0| 0| 0|
|poppr |2.4.1 | 1| 0| 0|
|preText |0.6.0 | 0| 0| 0|
|sicegar |0.2 | 0| 0| 0|
|tadaatoolbox |0.13.0 | 0| 0| 1|
|pcr |1.0.1 | 0| 0| 0|
|poppr |2.5.0 | 1| 0| 0|
|preText |0.6.1 | 0| 0| 0|
|RNOmni |0.1.3 | 0| 0| 0|
|Seurat |2.1.0 | 1| 0| 1|
|sicegar |0.2.2 | 0| 0| 0|
|survivALL |0.9.1 | 1| 0| 0|
|tadaatoolbox |0.14.0 | 0| 0| 1|
|valr |0.3.1 | 0| 0| 1|
|vanddraabe |1.0.0 | 0| 0| 0|
14 changes: 7 additions & 7 deletions man/draw_image.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions man/draw_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions man/draw_text.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/theme_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7bd1f97

Please sign in to comment.