From 7470b6071e37eb7758bed71a4eeffef4b4ded537 Mon Sep 17 00:00:00 2001 From: Petr Bouchal Date: Sat, 17 Oct 2020 13:58:37 +0200 Subject: [PATCH] clarify documentation of facet_geo(), closes #270 1) make it clear facet_geo can take a data.frame containing a grid 2) point to functions for discovering and inspecting grids --- DESCRIPTION | 2 +- R/facet_geo.R | 3 ++- man/facet_geo.Rd | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fa0ad95..1b4712d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,5 +29,5 @@ Suggests: rmarkdown URL: https://github.com/hafen/geofacet BugReports: https://github.com/hafen/geofacet/issues -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 VignetteBuilder: knitr diff --git a/R/facet_geo.R b/R/facet_geo.R index 6d312b7..e895bfa 100644 --- a/R/facet_geo.R +++ b/R/facet_geo.R @@ -2,7 +2,8 @@ #' #' @param facets passed to \code{\link[ggplot2]{facet_wrap}} #' @param \ldots additional parameters passed to \code{\link[ggplot2]{facet_wrap}} -#' @param grid character vector of the grid layout to use (currently only "us_state_grid1" and "us_state_grid2" are available) +#' @param grid either a character vector of the grid layout to use (see `?grids` for the list and use `get_grid()` to inspect or `grid_preview()` to plot a specific grid), +#' or a data.frame object containing a grid (e.g. an output from `grid_design()` or `grid_auto()`) #' @param label an optional string denoting the name of a column in \code{grid} to use for facet labels. If NULL, the variable that best matches that in the data specified with \code{facets} will be used for the facet labels. #' @param move_axes should axis labels and ticks be moved to the closest panel along the margins? #' @example man-roxygen/ex-facet_geo.R diff --git a/man/facet_geo.Rd b/man/facet_geo.Rd index 2f5178d..4f1df8e 100644 --- a/man/facet_geo.Rd +++ b/man/facet_geo.Rd @@ -9,7 +9,8 @@ facet_geo(facets, ..., grid = "us_state_grid1", label = NULL, move_axes = TRUE) \arguments{ \item{facets}{passed to \code{\link[ggplot2]{facet_wrap}}} -\item{grid}{character vector of the grid layout to use (currently only "us_state_grid1" and "us_state_grid2" are available)} +\item{grid}{either a character vector of the grid layout to use (see `?grids` for the list and use `get_grid()` to inspect or `grid_preview()` to plot a specific grid), +or a data.frame object containing a grid (e.g. an output from `grid_design()` or `grid_auto()`)} \item{label}{an optional string denoting the name of a column in \code{grid} to use for facet labels. If NULL, the variable that best matches that in the data specified with \code{facets} will be used for the facet labels.}