library(tidyverse)
theme_set(theme_minimal())
mt <- read.csv(url('https://gist.githubusercontent.com/ashtonanderson/cfbf51e08747f60472ee2132b0d35efb/raw/80acd2ad7c0fba4e85c053e61e9e5457137e00ee/moveno_piecetype_counts'))
mt$piece_type <- factor(
mt$piece_type,
levels = c("P","N","B","Q","R","O","K"),
labels = c(
library(sf) | |
library(ensurer) | |
library(assertr) | |
library(dplyr) | |
library(fgdr) | |
library(jpmesh) | |
library(readr) | |
library(ggplot2) | |
library(cowplot) | |
library(biscale) |
--- | |
title: "Tweet thread" | |
author: "Elio Campitelli" | |
output: github_document | |
--- | |
```{r} | |
knitr::opts_chunk$set(dev = "png", | |
tweet_this = TRUE) |
#=============================================================================== | |
# 2019-07-19-- ikashnitsky.github.io | |
# Reproduce Figure 2 from http://doi.org/10.1007/s10708-018-9953-5 | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(hrbrthemes); import_roboto_condensed() | |
# the data as tribble |
<script> | |
(function() { | |
var divHTML = document.querySelectorAll(".details-open"); | |
divHTML.forEach(function (el) { | |
var preNodes = el.getElementsByTagName("pre"); | |
var outputNode = preNodes[1]; | |
outputNode.outerHTML = "<details open class='output'><summary>Output</summary>" + outputNode.outerHTML + "</details>"; | |
}) | |
})(); | |
(function() { |
"Footedness" is a concept you're probably familiar with. Players almost always naturally prefer to dribble / shoot / pass with a certain foot. Total ambidexterity (being as comfortable using one foot as the other) is rarer, but is common enough at the top level.
One of the ways in which we can quantify footedness for a player is looking at how many shots or goals the player scores using one foot vs. the other. However, this isn't that meaningful for us because the majority of the time, we can see with our own eyes which foot a player prefers.
On the other hand, footedness of teams is more interesting to me. Here I've looked at which teams prefer one foot over the other or are ambidextrous, using a new metric I've called the "Ambidexterity Index" (AI). The source for all data described here is Understat; full credit to them.
#' Description | |
#' This file runs a live election-night forecast based on The Economist's pre-election forecasting model | |
#' available at projects.economist.com/us-2020-forecast/president. | |
#' It is resampling model based on https://pkremp.github.io/update_prob.html. | |
#' This script does not input any real election results! You will have to enter your picks/constraints manually (scroll to the bottom of the script). | |
#' | |
#' Licence | |
#' This software is published by *[The Economist](https://www.economist.com)* under the [MIT licence](https://opensource.org/licenses/MIT). The data generated by *The Economist* are available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). | |
#' The licences include only the data and the software authored by *The Economist*, and do not cover any *Economist* content or third-party data or content made available using the software. More information about licensing, syndication and the copyright of *Economist* content can be fou |
``` r | |
library(ggplot2) | |
library(dplyr) | |
library(magick) | |
library(patchwork) | |
library(gt) | |
library(ggtext) | |
mtcars %>% | |
head() %>% |
#################################### | |
# 月*100+日 | |
# 9月5日 --> 905 | |
#################################### | |
library(readr) | |
library(dplyr) | |
library(ggplot2) | |
library(ggalt) | |
d <- | |
read_csv("~/Downloads/normal_phenology/nml_phenology.csv", |
library(tidyverse)
library(tidycensus)
library(sf)
#> Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1
library(viridis)
#> Loading required package: viridisLite
library(patchwork)
theme_set(silgelib::theme_plex())