Skip to content

Commit

Permalink
checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnold committed Jan 7, 2016
1 parent 4d2d87a commit f630620
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 30 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Expand Up @@ -10,3 +10,4 @@
^\.Rproj\.user$
^\.travis\.yml$
^data-raw$
^\.lintr$
12 changes: 7 additions & 5 deletions DESCRIPTION
Expand Up @@ -13,24 +13,26 @@ Authors@R: c(person("Jeffrey B.", "Arnold", role = c("aut", "cre"),
comment = "Code from the ggplot2 package."),
person("Justin", "Talbot", role = "ctb",
comment = "Code from the labeling package"))
Depends:
Depends:
R (>= 3.0.0),
Imports:
Imports:
assertthat,
colorspace,
ggplot2 (>= 2.0.0),
graphics,
grid,
methods,
scales
Suggests:
Suggests:
extrafont,
knitr,
maps,
mapproj,
pander,
plyr,
reshape2
reshape2,
testthat,
lintr
VignetteBuilder: knitr
Description: Some extra themes, geoms, and scales for `ggplot2`.
Provides `ggplot2` themes and scales that replicate the look of plots
Expand All @@ -40,7 +42,7 @@ Description: Some extra themes, geoms, and scales for `ggplot2`.
License: GPL-2
URL: http://github.com/jrnold/ggthemes
BugReports: http://github.com/jrnold/ggthemes
Collate:
Collate:
'banking.R'
'base.R'
'calc.R'
Expand Down
6 changes: 3 additions & 3 deletions R/banking.R
Expand Up @@ -204,16 +204,16 @@ bank_slopes_ao <- function(slopes, weight = TRUE, ...) {
f <- function(alpha, slopes) {
(mean(abs(atan(slopes$s / alpha))) - FORTY_FIVE) ^ 2
}
nlm(f, alpha0, slopes = slopes)$estimate
}
nlm(f, alpha0, slopes = slopes)$estimate
}

bank_slopes_gor <- function(slopes, ...) {
alpha0 <- bank_slopes_ms(slopes)
s <- slopes$s
f <- function(alpha) {
theta <- atan(s / alpha) * -mean(as.numeric(dist(theta,
method = "manhattan")))
theta <- atan(s / alpha)
- mean(as.numeric(dist(theta, method = "manhattan")))
}
nlm(f, alpha0)$estimate
}
Expand Down
7 changes: 4 additions & 3 deletions R/stata.R
Expand Up @@ -117,7 +117,7 @@ theme_stata_base <- function(base_size = 11, base_family = "sans") {
hjust = 0.5,
vjust = 1),
plot.margin = unit(rep(0.035, 4), "npc"),
complete=TRUE)
complete = TRUE)
}

theme_stata_colors <- function(scheme="s2color") {
Expand Down Expand Up @@ -194,9 +194,10 @@ theme_stata_colors <- function(scheme="s2color") {
plot.background = element_rect(fill = color_plot))
}

#" Themes based on Stata graph schemes
#' Themes based on Stata graph schemes
#'
#' @param scheme One of "s2color", "s2mono", "s1color", "s1rcolor", or "s1mono", "s2manual",
#' @param scheme One of "s2color", "s2mono", "s1color",
#' "s1rcolor", or "s1mono", "s2manual",
#' "s1manual", or "sj"
#' @inheritParams ggplot2::theme_grey
#' @export
Expand Down
12 changes: 6 additions & 6 deletions man/bank_slopes.Rd

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

8 changes: 6 additions & 2 deletions man/hc_pal.Rd

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

2 changes: 1 addition & 1 deletion man/scale_colour_gradient_tableau.Rd

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

9 changes: 6 additions & 3 deletions man/tableau_div_gradient_pal.Rd

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

3 changes: 2 additions & 1 deletion man/theme_stata.Rd

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

2 changes: 1 addition & 1 deletion man/theme_wsj.Rd

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

16 changes: 11 additions & 5 deletions man/wsj_pal.Rd

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

4 changes: 4 additions & 0 deletions tests/testthat.R
@@ -0,0 +1,4 @@
library(testthat)
library(ggthemes)

test_check("ggthemes")
6 changes: 6 additions & 0 deletions tests/testthat/test-linters.R
@@ -0,0 +1,6 @@
if (requireNamespace("lintr", quietly = TRUE)) {
context("lints")
test_that("Package Style", {
lintr::expect_lint_free()
})
}

0 comments on commit f630620

Please sign in to comment.