rstudio::conf(2020L)
document()Code > Insert Roxygen SkeletonCode > Insert Roxygen SkeletonCode > Insert Roxygen Skeleton










document()document()theme_mako <- function(base_size = 14) { ggplot2::theme_dark(base_size = base_size) + ggplot2::theme( panel.background = ggplot2::element_rect(fill = "#0D98BA") )}document()#' A dark theme with a mako-like background#'#' @param base_size base font size#'#' @return a ggplot2 theme#' @export#'#' @examples#'#' ggplot2::quickplot(iris$Sepal.Length) + theme_mako()#'theme_mako <- function(base_size = 14) { ggplot2::theme_dark(base_size = base_size) + ggplot2::theme( panel.background = ggplot2::element_rect(fill = "#0D98BA") )}
man/theme_mako.Rd## % Generated by roxygen2: do not edit by hand## % Please edit documentation in R/themes.R## \name{theme_mako}## \alias{theme_mako}## \title{A dark theme with a mako-like background}## \usage{## theme_mako(base_size = 14)## }## \arguments{## \item{base_size}{base font size}## }## \value{## a ggplot2 theme## }## \description{## A dark theme with a mako-like background## }## \examples{## ## ggplot2::quickplot(iris$Sepal.Length) + theme_mako()## ## }

use_roxygen_md() lets you write in Markdown. See more at https://roxygen2.r-lib.org/articles/rd-formatting.htmluse_roxygen_md()r/themes.R. Insert a roxygen skeleton for theme_avalanche().#'. Add this text: "Minimalistic ggplot themes for use on AVALANCHE reports."document() or press Ctrl/Cmd + Shift + D. Read the help page for your function with ?theme_avalanche.exportPattern("^[^\\.]")#' AVALANCHE ggplot2 themes#' #' Minimalistic ggplot themes for use on AVALANCHE reports.#'#' @param base_size #' @param ... #'#' @return#' @export#'#' @examplestheme_avalanche <- function(base_size = 14, ...) { ggplot2::theme_minimal(base_size = base_size, ...) + ggplot2::theme(panel.grid.minor = ggplot2::element_blank())}# Generated by roxygen2: do not edit by handexport("%>%")export(db_con)export(get_resident_data)export(theme_avalanche)export(theme_avalanche_h)export(theme_avalanche_v)import(data.table)importFrom(magrittr,"%>%")#' [other roxygen code]#' @param x The name of a database to retrieveget_data <- function(x) { # code to get data}#' [other roxygen code]#' @param x The name of a database to retrieveget_data <- function(x) { # code to get data}#' [other roxygen code]filter_table <- function(x) { tbl <- get_data(x) # code to filter data}#' [other roxygen code]#' @param x The name of a database to retrieveget_data <- function(x) { # code to get data}#' [other roxygen code]#' @inheritParams get_datafilter_table <- function(x) { tbl <- get_data(x) # code to filter data}#' [other roxygen code]#' @examples#'#' library(dplyr)#' get_data("daily_actice_users") %>%#' filter(date == lubridate::today())get_data <- function(x) { # code to get data}#' [other roxygen code]#' @examples #' #' library(dplyr)#' get_data("daily_actice_users") %>% #' filter(date == lubridate::today())get_data <- function(x) { # code to get data}
dontrun{} or donttest{}#' [other roxygen code]#' @examples #'#' dontrun{#' get_data("daily_active_users")#' }get_data <- function(x) { # code to get data}theme_avalanche():@param base_size and replace it with: @inheritParams ggplot2::theme_minimal@param ..., add: Additional arguments passed to [ggplot2::theme_minimal()]@return, add: a ggplot theme.@examples, add two line breaks (make sure the new lines have roxygen comments!). Add this code: ggplot2::qplot(iris$Sepal.Length) + theme_avalanche()#' AVALANCHE ggplot2 themes#'#' Minimalistic ggplot themes for use on AVALANCHE reports.#'#' @inheritParams ggplot2::theme_minimal#' @param ... Additional arguments passed to [ggplot2::theme_minimal()]#'#' @return a ggplot theme.#' @export#'#' @examples#'#' ggplot2::qplot(iris$Sepal.Length) + theme_avalanche()#'theme_avalanche <- function(base_size = 14, ...) { ggplot2::theme_minimal(base_size = base_size, ...) + ggplot2::theme(panel.grid.minor = ggplot2::element_blank())}plot_daus <- function(daily_users) { daily_users <- daily_users %>% dplyr::mutate(date = as.Date(time)) %>% dplyr::group_by(date) dplyr::select(user_id) %>% dplyr::distinct() %>% dplyr::summarize(n = dplyr::n()) ggplot2::ggplot(ggplot2::aes(daily_users, x, n)) + ggplot2::geom_col()}plot_daus <- function(daily_users) { daily_users <- count_daus(daily_users) ggplot2::ggplot(ggplot2::aes(daily_users, x, n)) + ggplot2::geom_col()}count_daus <- function(daily_users) { daily_users %>% dplyr::mutate(date = as.Date(time)) %>% dplyr::group_by(date) dplyr::select(user_id) %>% dplyr::distinct() %>% dplyr::summarize(n = dplyr::n()) }#' Plot daily active users#' #' @param ...#' @export plot_daus <- function(...) { # ... code to plot daily active users}#' Count daily active users#' #' @param ...count_daus <- function(...) { # ... code to count daily active users}#' Plot daily active users#' #' @param ...#' @exportplot_daus <- function(...) { # ... code to plot daily active users}#' Count daily active users#' #' @param ...count_daus <- function(...) { # ... code to count daily active users}@export = shinRa::plot_daus()@export = shinRa::plot_daus()library(shinRa)plot_daus() ✔️@export = shinRa:::count_daus()@export = shinRa:::count_daus()library(shinRa)count_daus() 🤔🤔🤔🤔🤔🤔#' [other roxygen code]#' @param x The name of a database to retrieve get_data <- function(x) { # code to get data}#' [other roxygen code]#' @param x @inheritParam get_data filter_table <- function(x) { tbl <- get_data(x) # code to filter data}#' [other roxygen code]#' @param x The name of a database to retrieve get_data <- function(x) { # code to get data}#' @rdname get_data#' @exportfilter_table <- function(x) { tbl <- get_data(x) # code to filter data}#' [other roxygen code]#' @param x The name of a database to retrieve #' @name data_helpersNULL#' @rdname data_helpers#' @export get_data <- function(x) { # code to get data}#' @rdname data_helpers#' @export filter_table <- function(x) { tbl <- get_data(x) # code to filter data}#' [other roxygen code]#' @param x The name of a database to retrieve #' @name data_helpers NULL #' @rdname data_helpers #' @exportget_data <- function(x) { # code to get data}#' @rdname data_helpers #' @exportfilter_table <- function(x) { tbl <- get_data(x) # code to filter data}R/themes.R, join the documentation of theme_avalanche_h() and theme_avalanche_v() to theme_avalanche() by replacing the roxygen code for the first two functions with "#' @rdname theme_avalanche".?theme_avalanche_h()#' @rdname theme_avalanche#' @exporttheme_avalanche_h <- function(base_size = 14, ...) { ggplot2::theme_minimal(base_size = base_size, ...) + ggplot2::theme( panel.grid.minor = ggplot2::element_blank(), panel.grid.major.x = ggplot2::element_blank() )}#' @rdname theme_avalanche#' @exporttheme_avalanche_v <- function(base_size = 14, ...) { ggplot2::theme_minimal(base_size = base_size, ...) + ggplot2::theme( panel.grid.minor = ggplot2::element_blank(), panel.grid.major.y = ggplot2::element_blank() )}use_package_doc()## ✔ Setting active project to '/private/var/folders/03/9x7925g54mncswxx06wpkxl00000gn/T/Rtmp7tPP...## ✔ Writing 'R/shinRa-package.R'help("tidyr")
use_pkgdown()
Keyboard shortcuts
| ↑, ←, Pg Up, k | Go to previous slide |
| ↓, →, Pg Dn, Space, j | Go to next slide |
| Home | Go to first slide |
| End | Go to last slide |
| Number + Return | Go to specific slide |
| b / m / f | Toggle blackout / mirrored / fullscreen mode |
| c | Clone slideshow |
| p | Toggle presenter mode |
| t | Restart the presentation timer |
| ?, h | Toggle this help |
| Esc | Back to slideshow |