diff --git a/DESCRIPTION b/DESCRIPTION index 1e2b33d..17d3c43 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: firatheme Type: Package Title: A ggplot2 theme using the Fira Sans font -Version: 0.2.2 +Version: 0.2.3 Author: Erik-Jan van Kesteren Maintainer: Erik-Jan van Kesteren Description: Make your graphs pretty with the Fira font, colours and prettified @@ -11,4 +11,4 @@ Encoding: UTF-8 LazyData: true Imports: ggplot2, extrafont -RoxygenNote: 6.0.1 +RoxygenNote: 7.1.1 diff --git a/NAMESPACE b/NAMESPACE index 42f93fe..4490275 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,3 +7,5 @@ export(scale_color_fira) export(scale_colour_fira) export(scale_fill_fira) export(theme_fira) +importFrom(grDevices,pdfFonts) +importFrom(grDevices,windowsFonts) diff --git a/R/0tools.R b/R/0tools.R index dac069a..31d57bf 100644 --- a/R/0tools.R +++ b/R/0tools.R @@ -1,3 +1,4 @@ +#' @importFrom grDevices pdfFonts windowsFonts .onAttach <- function(libname, pkgname) { ## Load all fonts extrafont::loadfonts(quiet = TRUE) diff --git a/README.md b/README.md index 7f853f6..4e2c681 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
-This is a `ggplot2` theme I use on my [blog](http://erikjanvankesteren.nl/blog/) and elsewhere. You can use it and adapt it if you want. It's designed to be truly plug-and-play. See [below](#example-plots) for examples. +This is a `ggplot2` theme I use for almost all my plots. You can use it and adapt it if you want. It's designed to be truly plug-and-play. See [below](#example-plots) for examples.


@@ -27,7 +27,7 @@ On mac computers, first install the [`Fira Sans`](https://fonts.google.com/speci ```R -devtools::install_github("vankesteren/firatheme") +remotes::install_github("vankesteren/firatheme") ``` The preferred way to save plots is via the `firaSave()` function. For png output, this works out of the box. diff --git a/man/firaCols.Rd b/man/firaCols.Rd index f3ba24c..3597cae 100644 --- a/man/firaCols.Rd +++ b/man/firaCols.Rd @@ -4,7 +4,9 @@ \name{firaCols} \alias{firaCols} \title{Fira theme colours} -\format{An object of class \code{character} of length 5.} +\format{ +An object of class \code{character} of length 5. +} \usage{ firaCols } diff --git a/man/scale_fira.Rd b/man/scale_fira.Rd index ae14eac..8e53447 100644 --- a/man/scale_fira.Rd +++ b/man/scale_fira.Rd @@ -13,37 +13,41 @@ scale_colour_fira(..., continuous = FALSE) scale_color_fira(..., continuous = FALSE) } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{breaks}{One of: +\item{...}{ + Arguments passed on to \code{\link[ggplot2:discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer +argument (the number of levels in the scale) returns the values that +they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks -\item \code{waiver()} for the default breaks computed by the -transformation object +\item \code{waiver()} for the default breaks (the scale limits) \item A character vector of breaks \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale -and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{limits}}{One of: +\itemize{ +\item \code{NULL} to use the default scale values +\item A character vector that defines possible values of the scale and their +order +\item A function that accepts the existing (automatic) values and returns +new ones +}} + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic -value should missing be displayed as? Does not apply to position scales -where \code{NA} is always placed at the far right.} - \item{scale_name}{The name of the scale} - \item{palette}{A palette function that when called with a single integer -argument (the number of levels in the scale) returns the values that -they should take} - \item{name}{The name of the scale. Used as axis or legend title. If + \item{\code{scale_name}}{The name of the scale that should be used for error messages +associated with this scale.} + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -52,18 +56,18 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{expand}{Vector of range expansion constants used to add some -padding around the data, to ensure that they are placed some distance -away from the axes. Use the convenience function \code{\link[=expand_scale]{expand_scale()}} + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some +padding around the data to ensure that they are placed some distance +away from the axes. Use the convenience function \code{\link[ggplot2:expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{guide}{A function used to create a guide or its name. See -\code{\link[=guides]{guides()}} for more info.} - \item{position}{The position of the axis. "left" or "right" for vertical -scales, "top" or "bottom" for horizontal scales} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{guide}}{A function used to create a guide or its name. See +\code{\link[ggplot2:guides]{guides()}} for more information.} + \item{\code{position}}{For position scales, The position of the axis. +\code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{continuous}{whether the associated variable should be considered continuous. Typically used after "Error: Continuous value supplied to