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
find_name_index <- function(haystack, needle, idx=c()) { | |
if (hasName(haystack, needle)) { | |
c(idx, which(names(haystack)==needle)) | |
} else if (is.list(haystack)) { | |
for (i in seq_along(haystack)) { | |
obj <- haystack[[i]] | |
ret <- Recall(obj, needle, c(idx,i)) | |
if (!is.null(ret)) return(ret) | |
} | |
} else { |
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
obs = obslua | |
source_name = "" | |
total_seconds = 0 | |
timer_state = 0 | |
time_delta = 30 | |
cur_seconds = 0 | |
last_text = "" | |
stop_text = "" | |
activated = false |
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(httr) | |
library(jsonlite) | |
library(ggplot2) | |
library(ggrepel) | |
variant <- "4-74853287-G-A" | |
getVariantData <- function(variant) { | |
raw <- GET(paste0("http://pheweb.sph.umich.edu/FinMetSeq/variant/", variant)) | |
html <- content(raw, as="text") |
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(gapminder) | |
library(dplyr) | |
library(ggplot2) | |
library(ggthemes) | |
mapdata <- map_data("world") %>% | |
mutate(region = recode(region, | |
USA="United States", | |
UK="United Kingdom")) |
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
x | y | |
---|---|---|
32.3311102266 | 61.411101248 | |
53.4214628807 | 26.1868803879 | |
63.92020226 | 30.8321939163 | |
70.2895057187 | 82.5336485877 | |
34.1188302357 | 45.7345513203 | |
67.6707164012 | 37.110947969 | |
53.2591294055 | 97.4757710964 | |
63.5149808671 | 25.1000785788 | |
67.9805388133 | 80.9571652197 |
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
panel.barchart.alpha <- function (x, y, box.ratio = 1, box.width = box.ratio/(1 + box.ratio), | |
horizontal = TRUE, origin = NULL, reference = TRUE, stack = FALSE, | |
groups = NULL, col = if (is.null(groups)) plot.polygon$col else superpose.polygon$col, | |
border = if (is.null(groups)) plot.polygon$border else superpose.polygon$border, | |
lty = if (is.null(groups)) plot.polygon$lty else superpose.polygon$lty, | |
lwd = if (is.null(groups)) plot.polygon$lwd else superpose.polygon$lwd, | |
alpha = if (is.null(groups)) plot.polygon$alpha else superpose.polygon$alpha, | |
..., identifier = "barchart") | |
{ | |
plot.polygon <- trellis.par.get("plot.polygon") |
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
# List a variable names (that are not functions) in | |
# a quosure | |
# ideas taken from https://adv-r.hadley.nz/expressions.html | |
find_vars <- function(x) { | |
extr <- function(x) | |
if (is.symbol(x)) { | |
as.character(x) | |
} else if (is.pairlist(x)) { | |
purrr::flatten_chr(purrr::map(as.list(x), find_vars)) |
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
Sub animate_to() | |
Dim oslide As slide | |
Set oslide = ActiveWindow.View.slide | |
Dim oeff As effect | |
Dim oani As AnimationBehavior | |
Dim pHeight As Single | |
Dim pWidth As Single | |
With ActivePresentation.PageSetup | |
pHeight = .SlideHeight |
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(tidyverse) | |
mydata <- tibble::rowid_to_column(mpg) | |
ui <- fluidPage( | |
titlePanel("Sparkler"), | |
plotOutput("facet1", brush="facet1_brush"), | |
textOutput("numsel"), | |
actionButton("done", "Done") |
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: "Dplyr Introduction" | |
author: "Matthew Flickinger" | |
date: "July 12, 2017" | |
output: | |
pdf_document: default | |
html_document: default | |
--- | |
```{r setup, include=FALSE} |
NewerOlder