git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
require(quantmod) | |
require(ggplot2) | |
require(reshape2) | |
require(plyr) | |
require(scales) | |
# Download some Data, e.g. the CBOE VIX | |
getSymbols("^VIX",src="yahoo") | |
# Make a dataframe |
max_plots <- 5 | |
ui <- fluidPage( | |
headerPanel("Dynamic number of plots"), | |
sidebarPanel( | |
sliderInput("n", "Number of plots", value=1, min=1, max=5) | |
), |
Basic waffle charts using Mike Bostock's [http://bost.ocks.org/mike/chart/](reusable charts) convention. Waffles are configurable, as you can see below:
var waffle = new WaffleChart()
.selector(".chart")
.data(data)
.useWidth(false)
.label("Value of producers' sales in 2013, in thousands of dollars")
library(ggplot2) | |
library(FField) | |
# You'll have to play with repulsion, cex.x, and cex.y to get satisfactory results. | |
plot_text <- function(x, y, label, repulsion = 1, cex.x = 110, cex.y = 40) { | |
dat <- data.frame(xpos = x, ypos = y, label = label) | |
dat$label <- as.character(dat$label) | |
# Use the FField package to repel the text labels away from each other. | |
dat <- cbind( |
library(magick) | |
library(magrittr) | |
# Convert to 'ico' format | |
image_read("https://www.r-project.org/logo/Rlogo.png") %>% | |
image_scale("32x32!") %>% # remove the "!" after 32x32 to scale proportionally | |
image_write("favicon.ico", format = "ico") | |
# Favicon can also be png/gif |
#'@title html2tagList | |
#'@description convert raw html to htmltools tagList | |
#'@param x character vector of html | |
#'@examples | |
#' | |
#'x<-'<h1>Title</h1> | |
#' <h2>Header text</h2> | |
#' <p>Text here</p> | |
#' <h1>Title</h1> | |
#' <h2>Header text</h2> |
################################################################################ | |
# | |
# ikashnitsky.github.io 2017-06-30 | |
# Produce an RGB coded map of pop structures at NUTS-3 level | |
# Ilya Kashnitsky, [email protected] | |
# | |
################################################################################ | |
# load required packages | |
library(tidyverse) # data manipulation and viz |
Default ggplot2 aesthetics by geom.
geom | alpha | angle | colour | family | fill | fontface | height | hjust | lineheight | linetype | shape | size | stroke | vjust | weight | width | xmax | xmin | ymax | ymin |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GeomAbline | NA | black | 1 | 0.5 | ||||||||||||||||
GeomAnnotationMap | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
GeomArea | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
GeomBar | NA | NA | grey35 | 1 | 0. |
--- | |
title: "Programmatically create a document" | |
date: "`r Sys.Date()`" | |
output: | |
pagedown::html_paged: | |
toc: true | |
# change to true for a self-contained document, but it'll be a litte slower for Pandoc to render | |
self_contained: false | |
--- |