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(ggplot2) | |
library(ggrepel) | |
library(scales) | |
library(ggExtra) | |
library(ggthemes) | |
n<- c(1:10) | |
flips<- 2*(2^n-1) #number of coin flips required | |
prob <- 0.5^n # probability of achieving n in a row | |
percentage<-(round(prob,4)*100) |
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
http://stackoverflow.com/questions/35386124/embedding-a-r-leaflet-map-on-a-jekyll-site-hosted-on-github | |
http://stackoverflow.com/questions/34341808/is-there-a-way-to-add-a-gif-to-a-markdown-file |
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(ggplot2) | |
library(lubridate) | |
library(tidyr) | |
library(viridis) | |
#library(extrafont) # optional | |
library(lubridate) | |
library(gridExtra) | |
library(ggExtra) | |
library(dplyr) | |
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
# https://www.r-graph-gallery.com/283-the-hourly-heatmap.html | |
library(ggplot2) | |
library(dplyr) # easier data wrangling | |
library(viridis) # colour blind friendly palette, works in B&W also | |
library(Interpol.T) # will generate a large dataset on initial load | |
library(lubridate) # for easy date manipulation | |
library(ggExtra) # because remembering ggplot theme options is beyond me | |
library(tidyr) |
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
--- | |
layout: post | |
published: false | |
title: #Insert title here | |
subtitle: #Insert sub here | |
tags: | |
- rstats | |
- R | |
- r-bloggers | |
date: '2017-01-02' |
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
##### set up####### | |
library(dplyr) | |
library(wrapr) | |
data<-structure(list(Location = c("AreaZ", "AreaZ", "AreaZ", "AreaZ", | |
"AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", | |
"AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", "AreaZ", |
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
## see http://johnmackintosh.com/2017-06-01-UPDATED-let-there-be-progress/ for background | |
#### direct from the expert - code kindly provided via blog comment by John Mount, Win-Vector LLC | |
library("dplyr") | |
library("wrapr") | |
d <- data.frame( | |
location = c('AreaZ', 'AreaZ', 'AreaZ', 'AreaW', 'AreaW', 'AreaW'), |
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(rtweet) | |
library(tidyverse) | |
library(dplyr) | |
library(hrbrthemes) | |
library(extrafont) | |
library(viridis) | |
## create token named "twitter_token" | |
twitter_token <- create_token( | |
app = appname, |
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
mutate( Movement_Type = case_when( | |
Type == "Transfer In" ~ "Transfer", | |
Type == "Transfer Out" ~ "Transfer")) | |
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(readr) | |
library(ggplot2) | |
library(dplyr) | |
library(ggrepel) | |
data <- read_delim( | |
"Fixings.txt", "\t", escape_double = FALSE, | |
trim_ws = TRUE) |
OlderNewer