git clone git@github.com: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
max_plots <- 5 | |
ui <- fluidPage( | |
headerPanel("Dynamic number of plots"), | |
sidebarPanel( | |
sliderInput("n", "Number of plots", value=1, min=1, max=5) | |
), |
#' Add custom circle legend to leaflet map | |
#' | |
#' To be used alongside \code{leaflet::addCircleMarkers} | |
#' | |
#' @param map a leaflet map | |
#' @param title title of the legend | |
#' @param range vector of numeric values you want to scale the legend to (same vector used with addCircleMarkers) | |
#' @param scaling_fun the scaling function used with addCircleMarkers to scale circle radii appropriately for leaflet | |
#' @param color stroke color | |
#' @param weight stroke width in pixels |
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. |
library(leaflet) | |
library(sf) | |
library(rmapshaper) | |
library(dplyr, warn.conflicts = FALSE) | |
library(smoothr) | |
library(shiny) | |
u <- httr::GET('https://www.data.gouv.fr/api/1/datasets/5e7e104ace2080d9162b61d8/') | |
url_search <- httr::content(u)$resources |
#'@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, ilya.kashnitsky@gmail.com | |
# | |
################################################################################ | |
# load required packages | |
library(tidyverse) # data manipulation and viz |
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")
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 |
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 |