-As there is the potential for many plots to be produced in the `fasstr` functions, a tidy method was used to create multiple plots simultaneously in an efficient process using `dplyr`, `tidyr`, `purrr`, and `ggplot2` packages to create a tibble of plots. See this [webpage](http://www.brodrigues.co/blog/2017-03-29-make-ggplot2-purrr/) for more information on the method. For `fasstr` plotting functions, this entails creating a single tibble of groups ('STATION_NUMBER's), data, and plots. First the data is grouped by the grouping (typically 'STATION_NUMBER's) using the `dplyr::group()` function; this will create a single plot for each grouping. Then using `tidyr::nest()` a tibble is created with two columns, the first being the 'STATION_NUMBER' and the second being a tibble of data for each 'STATION_NUMBER' (a tibble of tibbles). Then using `dplyr::mutate()` function a column of ggplots is created; and using `purrr::map2()` all of the plots can be created simultaneously (thus saving time in the function). As this type of table isn't entirely user-friendly, each plot is extracted into a list and named appropriately (typically by each grouping and then the statistic).
0 commit comments