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
// Browser fingerprinting is a technique to "mark" anonymous users using JS | |
// (or other things). To build an "identity" of sorts the browser is queried | |
// for a list of its plugins, the screen size and several other things, then | |
// hashes them. The idea is that these bits of information produce an unique | |
// "fingerprint" of sorts; the more elaborate the list of data points is, the | |
// more unique this fingerprint becomes. And you wouldn't even need to set a | |
// cookie to recognize this user when she visits again. | |
// | |
// For more information on this topic consult | |
// [Ars Technica](http://arstechnica.com/tech-policy/news/2010/05/how-your-web-browser-rats-you-out-online.ars) |
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(nullabor) | |
library(ggplot2) | |
library(plyr) | |
theme_lineup <- function(base_size = 12, base_family = ""){ | |
theme_bw(base_size = base_size, base_family = base_family) %+replace% | |
theme(legend.position="none", | |
axis.text=element_blank(), | |
axis.title=element_blank(), | |
axis.ticks=element_blank())} |
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
// Define functions to render linked interactive plots using d3. | |
// Another script should define e.g. | |
// <script> | |
// var plot = new animint("#plot","path/to/plot.json"); | |
// </script> | |
// Constructor for animint Object. | |
var animint = function (to_select, json_file) { | |
var dirs = json_file.split("/"); | |
dirs.pop(); //if a directory path exists, remove the JSON file from dirs | |
var element = d3.select(to_select); |
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
// Define functions to render linked interactive plots using d3. | |
// Another script should define e.g. | |
// <script> | |
// var plot = new animint("#plot","path/to/plot.json"); | |
// </script> | |
// Constructor for animint Object. | |
var animint = function (to_select, json_file) { | |
var dirs = json_file.split("/"); | |
dirs.pop(); //if a directory path exists, remove the JSON file from dirs | |
var element = d3.select(to_select); |
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(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 |
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: "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 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 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 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 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) | |
``` |
OlderNewer