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
var $graphic = $('#graphic'); | |
var fmt_year_abbr = d3.time.format('%y'); | |
var fmt_year_full = d3.time.format('%Y'); | |
var graphic_data; | |
var graphic_data_url = 'data.csv'; | |
var graphic_default_width = 600; | |
var is_mobile; | |
var mobile_threshold = 540; | |
var pymChild = null; |
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
plot.cox.zph <- function (x, resid = TRUE, se = TRUE, df = 4, nsmo = 40, var, smoothcol="black", confcol="black", ...) { | |
xx <- x$x | |
yy <- x$y | |
d <- nrow(yy) | |
df <- max(df) | |
nvar <- ncol(yy) | |
pred.x <- seq(from = min(xx), to = max(xx), length = nsmo) | |
temp <- c(pred.x, xx) | |
lmat <- splines::ns(temp, df = df, intercept = TRUE) | |
pmat <- lmat[1:nsmo, ] |
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: "Mass Shootings Are Horrifying Enough Without Fudging The Numbers" | |
author: "Bob Rudis (@hrbrmstr)" | |
date: "August 28, 2015" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE, fig.retina=2) | |
``` |
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(RCurl) | |
library(reshape2) |
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(sltl) | |
out <- sltl(as.timeSeries(co2), | |
c.window=101, | |
c.degree=1, | |
type="monthly") | |
summary(out) | |
plot.sltl(out) |
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(scales) | |
library(grid) | |
library(gridExtra) | |
shinyServer(function(input, output) { | |
output$countPlot <- renderPlot({ | |
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
export PKG_LIBS=`Rscript --vanilla -e 'Rcpp:::LdFlags()'` | |
export PKG_CPPFLAGS=`Rscript --vanilla -e 'Rcpp:::CxxFlags()'` | |
R CMD SHLIB -lldns txt.cpp |
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: "Vectorize() Vectorization Example" | |
author: "Bob Rudis (@hrbrmstr)" | |
date: "May 16, 2014" | |
output: md_document | |
--- | |
```{r echo=FALSE, message=FALSE, error=FALSE, warning=FALSE} | |
library(Rcpp) | |
# We need this to ensure knitr+Rcpp can link to the boost library |
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: "Rcpp Vectorization Example" | |
author: "Bob Rudis (@hrbrmstr)" | |
date: "May 17, 2014" | |
output: md_document | |
--- | |
```{r echo=FALSE, message=FALSE, error=FALSE, warning=FALSE} | |
library(Rcpp) | |
library(bitops) | |
library(scales) |
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(data.table) | |
library(verisr) | |
library(dplyr) | |
library(statebins) | |
vcdb <- json2veris("/Users/bob/Desktop/r/VCDB-d3/VCDB/data/json/") | |
tbl_dt(vcdb) %>% | |
filter(victim.state %in% state.abb) %>% | |
group_by(victim.state) %>% | |
summarize(count=n()) %>% |
OlderNewer