This file contains hidden or 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
# About ------------------------------------------------------------------- | |
# This is a cheatsheet of code snippets and workflows that I've been adding to | |
# since I started my first package. I keep it open in RStudio while doing any | |
# dev work so I can execute code directly from the script. It owes a ton to "R | |
# Packages (2e)" by Hadley Wickham and Jennifer Bryan, still my main package dev | |
# reference. Please use and modify this as you see fit. FYI, I use RStudio for | |
# code editing, GitHub for versioning, and pkgdown for the package website, so | |
# this is written with those tools in mind. |
This file contains hidden or 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
# Dynamic UI: demonstrate destroy() method on observer | |
# This example makes use of a module that dynamically creates pages | |
# Each server part of the module creates an observer that listens to an actionButton | |
# Whenever a page is removed, the observer is destroyed. The UI is removed with | |
# the nav_remove() function. | |
library(shiny) | |
library(bslib) | |
sportsPageUI <- function(id, page_name) { |