Last active
July 17, 2020 08:37
-
-
Save MarkEdmondson1234/846a9b738aba8e300971161043f9d1d1 to your computer and use it in GitHub Desktop.
RStudio snippet to make a shortcut for Shiny Module scaffolding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet module | |
#' ${1:module_name} UI | |
#' | |
#' Shiny Module for use with \link{${1:module_name}} | |
#' | |
#' @param id Shiny id | |
#' | |
#' @return Shiny UI | |
${1:module_name}UI <- function(id){ | |
ns <- shiny::NS(id) | |
} | |
#' ${1:module_name} | |
#' | |
#' Shiny Module for use with \link{${1:module_name}UI} | |
#' | |
#' Call via \code{shiny::callModule(${1:module_name}, "your_id")} | |
#' | |
#' @param input shiny input | |
#' @param output shiny output | |
#' @param session shiny session | |
#' | |
#' @return Something | |
${1:module_name} <- function(input, output, session){ | |
ns <- session\$ns | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment