-
iTerm2
-
Command Line Tools
xcode-select –install
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
library(shiny) | |
library(bslib) | |
library(dplyr) | |
library(ggplot2) | |
# Sample cow data | |
cow_data <- data.frame( | |
name = c("Bessie", "Daisy", "Buttercup", "Molly", "Clover", "Rosie", "Bella", "Penny", "Lulu", "Mabel"), | |
breed = c("Holstein", "Jersey", "Angus", "Hereford", "Guernsey", "Simmental", "Holstein", "Jersey", "Angus", "Guernsey"), | |
milk_per_day = c(28, 25, 0, 0, 27, 0, 30, 24, 0, 26), |
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
# https://shiny.posit.co/blog/posts/bslib-dashboards/#hello-dashboards | |
library(shiny) | |
library(bslib) | |
library(ggplot2) | |
# Setup ------------------------------------------------------------------- | |
data(penguins, package = "palmerpenguins") |
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
--- | |
title: "Presentation Ninja" | |
subtitle: "⚔<br/>with xaringan" | |
author: "Yihui Xie" | |
date: "2016/12/12 (updated: `r Sys.Date()`)" | |
output: | |
xaringan::moon_reader: | |
lib_dir: libs | |
css: | |
- default |
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
snps <- | |
list(r = "~/.config/rstudio/snippets/r.snippets") %>% | |
purrr::map(readLines, warn = FALSE) %>% | |
purrr::map(paste, collapse = "\n") %>% | |
purrr::map(trimws) %>% | |
purrr::map(strsplit, split = "(^|\n)snippet ") %>% | |
purrr::map_depth(2, ~ .x[.x != ""]) %>% | |
purrr::map_depth(2, ~ { | |
nm <- gsub("^([^\n\t ]+).*", "\\1", .x) | |
names(.x) <- nm |
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
--- | |
title: Reading a YAML chunk | |
output: github_document | |
--- | |
Here's a simple YAML chunk (with the label `config`): | |
```{yaml config} | |
default: | |
user: "garrick" |
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
library(dplyr) | |
remotes <- gert::git_remote_list() | |
remotes |> | |
mutate( | |
url = sub("git@github.com:", "https://github.com/", url, fixed = TRUE), | |
url = sub(".git", "", url, fixed = TRUE) | |
) |> | |
purrr::pwalk(function(name, url) { |
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
alias_input_from_shiny <- function( | |
input = "actionLink", | |
update = NULL, | |
new_input = NULL, | |
new_update = NULL | |
) { | |
if (is.null(update)) { | |
update <- paste0("update", toupper(substr(input, 1, 1)), substring(input, 2)) | |
} |
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
#' Render Table of Contents | |
#' | |
#' A simple function to extract headers from an RMarkdown or Markdown document | |
#' and build a table of contents. Returns a markdown list with links to the | |
#' headers using | |
#' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers). | |
#' | |
#' WARNING: This function only works with hash-tag headers. | |
#' | |
#' Because this function returns only the markdown list, the header for the |
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
library(shiny) | |
if (!requireNamespace("praise", quietly = TRUE)) { | |
install.packages("praise") | |
} | |
ui <- shiny::fillPage( | |
bootstrap = FALSE, | |
actionLink("easy", class = "easy-button", "easy"), | |
uiOutput("not-hard"), |
NewerOlder