Skip to content

Instantly share code, notes, and snippets.

Avatar

Garrett Grolemund garrettgman

View GitHub Profile
@garrettgman
garrettgman / 0-update-web-pr.md
Last active Dec 6, 2018
How to make and update a pull request when you are using the web api
View 0-update-web-pr.md

To add a recipe or fix a typo in the Tidyverse cookbook, use a pull request. Here's how:

Make a pull request

  1. Visit the chapter of the Tidyverse cookbook that you wish to edit.
  2. Click the icon at the top of the page that looks like this .
  3. If prompted, click the green "Fork this repository and propose changes" button, which looks like this: This will open an editable copy of the chapter file.
  4. Make your changes to the file. If you are adding a recipe, try to match the R Markdown formatting that you see in the other recipes. Realize that your text may be edited later; this is not personal---in fact, it is a luxury.
@garrettgman
garrettgman / r-admin.md
Created Nov 28, 2018
R Administration Resources at the Enterprise Level
View r-admin.md
@garrettgman
garrettgman / foo.md
Last active Jan 18, 2022
The numbers 1 through 10000
View foo.md
##     [1]     1     2     3     4     5     6     7     8     9    10    11
##    [12]    12    13    14    15    16    17    18    19    20    21    22
##    [23]    23    24    25    26    27    28    29    30    31    32    33
##    [34]    34    35    36    37    38    39    40    41    42    43    44
##    [45]    45    46    47    48    49    50    51    52    53    54    55
##    [56]    56    57    58    59    60    61    62    63    64    65    66
##    [67]    67    68    69    70    71    72    73    74    75    76    77
##    [78]    78    79    80    81    82    83    84    85    86    87    88
##    [89]    89    90    91    92    93    94    95    96    97    98    99
@garrettgman
garrettgman / server.R
Created Mar 27, 2014
A lightweight example of permissions based on authorization. Note, I would need to actually collect user ids and see if they are authorized. For now, just toggle authorized to TRUE or FALSE in line 4 of server.R.
View server.R
library(shiny)
library(ggplot2)
authorized <- TRUE
shinyServer(function(input, output, session) {
if (authorized) {
data <- iris
p <- qplot(Sepal.Width, Sepal.Length, data = iris, color = Species)
View deck.csv
face suit value
king spades 13
queen spades 12
jack spades 11
ten spades 10
nine spades 9
eight spades 8
seven spades 7
six spades 6
five spades 5
@garrettgman
garrettgman / server.R
Created Sep 23, 2013
A very simple Shiny App
View server.R
library(shiny)
shinyServer(function(input, output) {
data <- reactive({
FUN <- switch(input$family,
"Normal" = rnorm,
"Uniform" = runif,
"Exponential" = rexp)
FUN(input$n)
})
@garrettgman
garrettgman / server.R
Last active May 9, 2022
A shiny app that helps you explore stock returns (by way of yahoo finance and quantmod)
View server.R
library(shiny)
library(quantmod)
library(VGAM)
# Define server logic for random distribution application
shinyServer(function(input, output) {
# acquiring data
dataInput <- reactive({
if (input$get == 0)
@garrettgman
garrettgman / counties.RDS
Last active Dec 22, 2015
A shiny app that helps you map demographic variables from the 2010 US Census