Skip to content

Instantly share code, notes, and snippets.

View aoles's full-sized avatar

Andrzej K. Oleś aoles

View GitHub Profile
model <- list()
#*********************************************************
#
model$savory$creamcheese$wheat$beta <- 1
model$savory$creamcheese$wheat$alpha <- 2
model$savory$creamcheese$wheat$gamma <- 3
#
model$savory$creamcheese$raisin$beta <- 4
model$savory$creamcheese$raisin$alpha <- 5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vIElmIHdpbmRvdy5IVE1MV2lkZ2V0cyBpcyBhbHJlYWR5IGRlZmluZWQsIHRoZW4gdXNlIGl0OyBvdGhlcndpc2UgY3JlYXRlIGEKICAvLyBuZXcgb2JqZWN0LiBUaGlzIGFsbG93cyBwcmVjZWRpbmcgY29kZSB0byBzZXQgb3B0aW9ucyB0aGF0IGFmZmVjdCB0aGUKICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLgogIHdpbmRvdy5IVE1MV2lkZ2V0cyA9IHdpbmRvdy5IVE1MV2lkZ2V0cyB8fCB7fTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLgogIHZhciB2aWV3ZXJNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnZpZXdlck1vZGUgPQogICAgICAvXGJ2aWV3ZXJfcGFuZT0xXGIvLnRlc3Qod2luZG93LmxvY2F0aW9uKTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gU2hpbnkgbW9kZS4gSWYgbm90LCBpdCdzIGEgc3RhdGljIGRvY3VtZW50LgogIC8vIE5vdGUgdGhhdCBzdGF0aWMgd2lkZ2V0cyBjYW4gYXBwZWFyIGluIGJvdGggU2hpbnkgYW5kIHN0YXRpYyBtb2RlcywgYnV0CiAgLy8gb2J2aW91c2x5LCBTaGlueSB3aWRnZXRzIGNhbiBvbmx5IGFwcGVhciBpbiBTaGlueSBhcHBzL2RvY3VtZW50cy4KICB2YXIgc2hpbnlNb2R
---
title: "London Blitz Bombs"
author: "Andrzej K. Oleś"
output: html_document
---
```{r config, include=FALSE}
## set up knitr defaults
knitr::opts_chunk$set(eval=TRUE, out.width='100%', out.height='560px')
```
---
title: "London Blitz Bombs"
author: "Andrzej K. Oleś"
output: html_document
---
```{r config, include=FALSE}
## set up knitr defaults
knitr::opts_chunk$set(eval=TRUE, out.width='100%', out.height='560px')
```
@aoles
aoles / app.R
Last active April 1, 2021 23:44
ORS directions demo Shiny app https://aoles.shinyapps.io/directions
library(shiny)
library(leaflet)
library(openrouteservice)
## User interface definition
ui <- bootstrapPage(
includeScript("busy_indicator.js"),
includeCSS("style.css"),
leafletOutput("map", width = "100%", height = "100%"),
absolutePanel(top = 10, right = 10, id="controls",
@aoles
aoles / app.R
Last active April 1, 2021 23:53
ORS isochrones demo Shiny app https://aoles.shinyapps.io/isochrones
library(shiny)
library(leaflet)
library(openrouteservice)
ui <- bootstrapPage(
includeScript("busy_indicator.js"),
includeScript("lazy_sliders.js"),
includeCSS("style.css"),
leafletOutput("map", width = "100%", height = "100%"),
absolutePanel(top = 10, right = 10, id="controls",
@aoles
aoles / bash.Rmd
Created October 8, 2018 10:09
Save bash code chunks in R Markdown documents into separate script files
---
output: html_document
---
```{r setup, include=FALSE}
knit_hooks_source <- knitr::knit_hooks$get("source")
knitr::knit_hooks$set(source = function (x, options) {
if (!is.null(options$save))
writeLines(x, options$save)
knit_hooks_source(x, options)
@aoles
aoles / mannheim.sh
Created October 25, 2018 10:32
Sample script for creating geographic extracts of OSM data
#!/bin/bash
URL=https://download.geofabrik.de/europe/germany/baden-wuerttemberg/karlsruhe-regbez-latest.osm.pbf
RELATION_ID=62691
RELATION_NAME=mannheim
###
echo "Downloading $URL"
SOURCE=$(basename "$URL")
curl $URL -o $SOURCE
@aoles
aoles / app.R
Last active June 15, 2020 12:03
Shiny app for comparing ORS cycling weighting alternatives https://aoles.shinyapps.io/cyclingWeightings/
library(shiny)
library(leaflet)
library(openrouteservice)
library(lubridate) #convert seconds to hh:mm
# Precomputed random routes in Bayern
load("routes.rda")
lapply(res, function(routes) {
sapply(routes, function(x) x$features[[1]]$properties$summary$distance/1000)