Skip to content

Commit

Permalink
markdown itemize & links
Browse files Browse the repository at this point in the history
  • Loading branch information
corybrunson committed Oct 12, 2018
1 parent 1dcaa71 commit 4d8b8b3
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 111 deletions.
35 changes: 16 additions & 19 deletions R/alluvial-data.r
Expand Up @@ -7,20 +7,17 @@
#' subsets or amounts of observations that take the corresponding values of the
#' corresponding variables. This function checks a data frame for either of two
#' types of alluvial structure:
#' \itemize{
#' \item One row per **lode**, wherein each row encodes a subset or
#' amount of observations having a specific profile of axis values, a
#' `key` field encodes the axis, a `value` field encodes the
#' value within each axis, and a `id` column identifies multiple
#' lodes corresponding to the same subset or amount of observations.
#' `is_lodes_form` tests for this structure.
#' \item One row per **alluvium**, wherein each row encodes a subset or
#' amount of observations having a specific profile of axis values and a
#' set `axes` of fields encodes its values at each axis variable.
#' `is_alluvia_form` tests for this structure.
#' }
#'

#' - One row per **lode**, wherein each row encodes a subset or amount of
#' observations having a specific profile of axis values, a `key` field
#' encodes the axis, a `value` field encodes the value within each axis, and a
#' `id` column identifies multiple lodes corresponding to the same subset or
#' amount of observations. `is_lodes_form` tests for this structure.
#' - One row per **alluvium**, wherein each row encodes a subset or amount of
#' observations having a specific profile of axis values and a set `axes` of
#' fields encodes its values at each axis variable. `is_alluvia_form` tests
#' for this structure.
#'
#' `to_lodes_form` takes a data frame with several designated variables to
#' be used as axes in an alluvial diagram, and reshapes the data frame so that
#' the axis variable names constitute a new factor variable and their values
Expand All @@ -43,22 +40,22 @@
#' "alluvia").
#' @param silent Whether to print messages.
#' @param key,value,id In `to_lodes_form`, handled as in
#' \code{\link[tidyr]{gather}} and used to name the new axis (key), stratum
#' [tidyr::gather()] and used to name the new axis (key), stratum
#' (value), and alluvium (identifying) variables. In `to_alluvia_form`,
#' handled as in \code{\link[tidyr]{spread}} and used to identify the fields
#' handled as in [tidyr::spread()] and used to identify the fields
#' of `data` to be used as the axis (key), stratum (value), and alluvium
#' (identifying) variables.
#' @param axes In `*_alluvia_form`, handled as in
#' \code{\link[dplyr]{select}} and used to identify the field(s) of
#' [dplyr::select()] and used to identify the field(s) of
#' `data` to be used as axes.
#' @param ... Used in `is_alluvia_form` and `to_lodes_form` as in
#' \code{\link[dplyr]{select}} to determine axis variables, as an alternative
#' [dplyr::select()] to determine axis variables, as an alternative
#' to `axes`. Ignored when `axes` is provided.
#' @param weight Optional field of `data`, handled using
#' \code{\link[rlang]{enquo}}, to be used as heights or depths of the alluvia
#' [rlang::enquo()], to be used as heights or depths of the alluvia
#' or lodes.
#' @param diffuse Fields of `data`, handled using
#' \code{\link[tidyselect]{vars_select}}, to merge into the reshapen data by
#' [tidyselect::vars_select()], to merge into the reshapen data by
#' `id`. They must be a subset of the axis variables. Alternatively, a
#' logical value indicating whether to merge all (`TRUE`) or none
#' (`FALSE`) of the axis variables.
Expand Down
4 changes: 2 additions & 2 deletions R/data.r
Expand Up @@ -4,12 +4,12 @@
#' kindly contributed by Raffaele Vardavas.
#'
#' @format An alluvial data frame in lodes form.
#' @source RAND American Life Panel \url{https://alpdata.rand.org/}
#' @source RAND American Life Panel <https://alpdata.rand.org/>
#' @name vaccinations
NULL

#' Student curricula across semesters
#'
#'
#' This dataset, kindly contributed by Dario Bonaretti, follows the curricula of
#' 10 students across 8 academic semesters.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ggproto.r
@@ -1,6 +1,6 @@
#' Base ggproto classes for ggalluvial
#'
#' @name ggalluvial-ggproto
#' @seealso \code{\link[ggplot2]{ggplot2-ggproto}}
#' @seealso [`ggplot2::ggplot2-ggproto`]
#' @keywords internal
NULL
20 changes: 9 additions & 11 deletions R/lode-guidance-functions.r
@@ -1,24 +1,22 @@
#' Lode guidance functions
#'
#' These functions control the order of lodes within strata in an alluvial
#' diagram. They are invoked by \code{\link{stat_alluvium}} and can be passed to
#' diagram. They are invoked by [stat_alluvium()] and can be passed to
#' the `lode.guidance` parameter.
#'

#' Each function orders the numbers 1 through `n`, starting at index
#' `i`. The choice of function made in \code{\link{stat_alluvium}}
#' `i`. The choice of function made in [stat_alluvium()]
#' determines the order in which the other axes contribute to the sorting of
#' lodes within each index axis. After starting at `i`, the functions order
#' the remaining axes as follows:
#' \itemize{
#' \item `zigzag`: Zigzag outward from `i`
#' \item `rightward`: Increasing order
#' \item `leftward`: Decreasing order
#' \item `rightleft`: Proceed rightward from `i` to `n`, then
#' leftward to 1
#' \item `leftright`: Proceed leftward from `i` to 1, then rightward
#' to `n`
#' }
#'
#' - `zigzag`: Zigzag outward from `i`
#' - `rightward`: Increasing order
#' - `leftward`: Decreasing order
#' - `rightleft`: Proceed rightward from `i` to `n`, then leftward to 1
#' - `leftright`: Proceed leftward from `i` to 1, then rightward to `n`
#'
#' @name lode-guidance-functions
#' @param n Numeric, a positive integer
#' @param i Numeric, a positive integer at most `n`
Expand Down
8 changes: 4 additions & 4 deletions R/self-adjoin.r
Expand Up @@ -5,27 +5,27 @@
#' form to something similar to alluvia form.
#'

#' `self_adjoin` invokes \code{\link[dplyr]{join}} functions in order to convert
#' `self_adjoin` invokes [`dplyr::join`] functions in order to convert
#' a dataset with measures along a discrete `key` variable into a dataset
#' consisting of column bindings of these measures (by any `by` variables) along
#' adjacent values of `key`.
#' @name self-adjoin
#' @import tidyselect
#' @family alluvial data manipulation
#' @param data A data frame in lodes form (repeated measures data; see
#' \code{\link{alluvial-data}}).
#' [`alluvial-data`]).
#' @param key Column of `data` indicating sequential collection; handled as in
#' [tidyr::spread()].
#' @param by Character vector of variables to self-adjoin by; passed to
#' \code{\link[dplyr]{join}} functions.
#' [`dplyr::join`] functions.
#' @param link Character vector of variables to adjoin. Will be replaced by
#' pairs of variables suffixed by `suffix`.
#' @param keep.x,keep.y Character vector of variables to associate with the
#' first (respectively, second) copy of `data` after adjoining. These
#' variables can overlap with each other but cannot overlap with `by` or
#' `link`.
#' @param suffix Suffixes to add to the adjoined `link` variables; passed to
#' \code{\link[dplyr]{join}} functions.
#' [`dplyr::join`] functions.
#' @example inst/examples/ex-self-adjoin.r
#' @export
self_adjoin <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/stat-alluvium.r
Expand Up @@ -23,7 +23,7 @@
#' @param lode.guidance The function to prioritize the axis variables for
#' ordering the lodes within each stratum. Options are "zigzag", "rightleft",
#' "leftright", "rightward", and "leftward" (see
#' \code{\link{lode-guidance-functions}}).
#' [`lode-guidance-functions`]).
#' @param lode.ordering A list (of length the number of axes) of integer vectors
#' (each of length the number of rows of `data`) or NULL entries
#' (indicating no imposed ordering), or else a numeric matrix of corresponding
Expand Down
24 changes: 12 additions & 12 deletions man-roxygen/geom-aesthetics.r
@@ -1,17 +1,17 @@
#' @section Aesthetics:
#' `geom_alluvium`, `geom_flow`, `geom_lode`, and `geom_stratum` understand the
#' following aesthetics (required aesthetics are in bold):
#' \itemize{
#' \item **`x`**
#' \item **`y`**
#' \item **`ymin`**
#' \item **`ymax`**
#' \item `alpha`
#' \item `colour`
#' \item `fill`
#' \item `linetype`
#' \item `size`
#' \item `group`
#' }
#'
#' - **`x`**
#' - **`y`**
#' - **`ymin`**
#' - **`ymax`**
#' - `alpha`
#' - `colour`
#' - `fill`
#' - `linetype`
#' - `size`
#' - `group`
#'
#' `group` is used internally; arguments are ignored.
#'
27 changes: 12 additions & 15 deletions man-roxygen/stat-aesthetics.r
@@ -1,29 +1,26 @@
#' @section Aesthetics:
#' `stat_alluvium`, `stat_flow`, and `stat_stratum` require one
#' of two sets of aesthetics:
#' \itemize{
#' \item **`x`** and at least one of
#' **`alluvium`** and **`stratum`**
#' \item any number of **`axis[0-9]*`**
#' (`axis1`, `axis2`, etc.)
#' }
#'
#' - **`x`** and at least one of **`alluvium`** and **`stratum`**
#' - any number of **`axis[0-9]*`** (`axis1`, `axis2`, etc.)
#'
#' Use `x`, `alluvium`, and/or `stratum` for data in lodes format
#' and `axis[0-9]*` for data in alluvia format
#' (see [`alluvial-data`]).
#' and `axis[0-9]*` for data in alluvia format (see [`alluvial-data`]).
#' Arguments to parameters inconsistent with the format will be ignored.
#' Additionally, each `stat_*` layer accepts the following optional
#' aesthetics:
#' \itemize{
#' \item `y`
#' \item `group`
#' }
#'
#' - `y`
#' - `group`
#'
#' `y` controls the heights of the alluvia
#' and may be aggregated across equivalent observations.
#' `group` is used internally; arguments are ignored.
#' Finally, `stat_stratum` accepts the following optional aesthetic:
#' \itemize{
#' \item `label`
#' }
#'
#' - `label`
#'
#' `label` is used to label the strata and must take a unique value across
#' the observations within each stratum.
#' These and any other aesthetics are aggregated as follows:
Expand Down
36 changes: 18 additions & 18 deletions man/alluvial-data.Rd

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

1 change: 1 addition & 0 deletions man/geom_alluvium.Rd

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

1 change: 1 addition & 0 deletions man/geom_flow.Rd

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

1 change: 1 addition & 0 deletions man/geom_lode.Rd

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

1 change: 1 addition & 0 deletions man/geom_stratum.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/ggalluvial-ggproto.Rd

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

10 changes: 4 additions & 6 deletions man/lode-guidance-functions.Rd

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

6 changes: 3 additions & 3 deletions man/self-adjoin.Rd

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

0 comments on commit 4d8b8b3

Please sign in to comment.