Skip to content

Instantly share code, notes, and snippets.

View garrettgman's full-sized avatar

Garrett Grolemund garrettgman

View GitHub Profile
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
Last active December 11, 2023 17:21
A shiny app that helps you explore stock returns (by way of yahoo finance and quantmod)
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 / foo.md
Last active June 16, 2023 04:14
The numbers 1 through 10000
##     [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 / 0-update-web-pr.md
Last active December 6, 2018 19:19
How to make and update a pull request when you are using the web api

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 November 28, 2018 15:07
R Administration Resources at the Enterprise Level
@garrettgman
garrettgman / server.R
Created September 23, 2013 16:35
A very simple Shiny App
library(shiny)
shinyServer(function(input, output) {
data <- reactive({
FUN <- switch(input$family,
"Normal" = rnorm,
"Uniform" = runif,
"Exponential" = rexp)
FUN(input$n)
})
@garrettgman
garrettgman / counties.RDS
Last active December 22, 2015 11:19
A shiny app that helps you map demographic variables from the 2010 US Census
@garrettgman
garrettgman / server.R
Created March 27, 2014 17:43
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.
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)