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
library(RSelenium) | |
library(rvest) | |
library(tidyverse) | |
# Newer versions of Selenium don't work that well... | |
rs_driver <- rsDriver(port = 4567L, version = "3.12.0") | |
rd <- rs_driver$client | |
rd$setImplicitWaitTimeout(milliseconds = 5000) | |
url <- function(m, y) sprintf("https://www.timeanddate.com/weather/@4846834/historic?month=%d&year=%d", m, y) |
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
shinyApp(ui = fluidPage(textOutput("con"), textOutput("fileexists")), | |
server = function(input, output) { | |
output$con <- renderPrint(con) | |
output$fileexists <- renderPrint(list.files(here::here())) | |
}) |
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
shinyApp(ui = fluidPage(textOutput("pwd")), | |
server = function(input, output) { | |
output$pwd <- renderText(list.files(here::here())) | |
}) |
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
main.table <- data.frame(Results = c("Exclusion", "Identification"), `Same Source` = c("Missed Identification", "Correct Identification"), `Different Source` = c("Correct Exclusion", "Wrong Identification")) | |
names(main.table) <- c("", "Same Source", "Different Source") | |
blank <- textGrob("") | |
gt <- textGrob("Ground Truth", gp = gpar(fontsize = 14, fontface = "bold")) | |
res <- textGrob("Results", rot = 90, gp = gpar(fontsize = 14, fontface = "bold")) | |
mt <- tableGrob(main.table, rows = NULL, theme = ttheme_default()) | |
layout.matrix <- matrix(c(1, 1, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4, 4), nrow = 4, byrow = T) |
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
--- | |
title: "Emoji" | |
author: "Susan VanderPlas" | |
date: "8/28/2018" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` |
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
# --- Packages ----------------------------------------------------------------- | |
library(ggplot2) # Plots | |
library(magrittr) # Pipes | |
library(dplyr) # Split-Apply-Combine | |
library(tidyr) # Reshape data | |
library(stringr) # String manipulation | |
library(lubridate) # Dates and times | |
library(readr) # Read in csv/tsv/fwf data | |
library(readxl) # Read in excel data | |
# ------------------------------------------------------------------------------ |
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
c0 <- knitr::knit_hooks$get('chunk') | |
knitr::knit_hooks$set( | |
list( | |
chunk=function(x,options){ | |
if(is.null(options$class) & is.null(options$fragIndex)){ | |
c0(x, options) | |
} else if(is.null(options$fragIndex)) { | |
classidx <- which(names(options)=="class") |
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
library(animint) | |
library(ggplot2) | |
data <- data.frame(x=rep(1:10, times=2), y=c(1:10, 2*(1:10)), type=rep(c("line1","line2"), each=10)) | |
plot1 <- | |
ggplot() + | |
geom_line(aes(x=x, y=y, group=type, color=type, tooltip=type), data=data) | |
# animint2dir(list(lineplot=plot1), out.dir="~/Web/animintexample3", open.browser=T) |
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
--- | |
title: "UnicodeTest" | |
author: "Susan VanderPlas" | |
date: "01/06/2015" | |
output: html_document | |
--- | |
Testing whether it's a browser/rendering issue, which makes no sense to me, but it wouldn't be the strangest error I've come across: | |
```{r} |
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
library(shiny) | |
library(ggplot2) | |
# library(Cairo) | |
# options(shiny.usecairo=T) | |
# Define colors and shapes | |
colors <- c("#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", | |
"#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf") | |
shapes1 <- c(1,0,3,4,8,5,2,6,-0x25C1, -0x25B7) | |
shapes2 <- 1:10 |