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
######################################################### | |
##### Script to load in KML and output to GeoJSON ##### | |
##### Robin Edwards, geotheory.co.uk, @geotheory ##### | |
######################################################### | |
# This script accepts a simple KML file (e.g. from Google Earth or Scribblemaps.com) and converts to GeoJSON. | |
# It will not accept KMLs with multiple geometries - they must be entirely of points, paths or polygons, | |
# or a primitive geometry (such as rectangle or circle) | |
# | |
# How to run: |
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
require(HiveR) | |
require(plyr) | |
require(colorspace) | |
require(classInt) | |
d = ggplot2::diamonds | |
d = d[,c(1:4,7)] | |
head(d); dim(d) | |
# separate carat-size data into equal interval groups |
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
require(maptools) | |
require(fields) | |
require(ggplot2) | |
require(stringr) | |
bng = "+init=epsg:27700" | |
workdir = '[change to working directory path]' | |
setwd(workdir) | |
R.utils::mkdirs('wz') |
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
# read in csv file with headings labelled 'e' and 'n' and output latlons | |
# call script by command-line: 'RScript bng_to_latlon.R {bng_filename.csv}' | |
require(rgdal) | |
args=(commandArgs(TRUE)) | |
datain = read.csv(args[1]) | |
bng = datain | |
coordinates(bng) = ~ e + n | |
bng@proj4string = CRS("+init=epsg:27700") | |
latlon = spTransform(bng, CRS("+proj=longlat +datum=WGS84")) |
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
/* | |
* Arduino Class for ArrayList | |
* Written: Obed Isai Rios | |
*/ | |
#include "Arduino.h" | |
#include "ArrayList.h" | |
ArrayList::ArrayList(char* init){ |
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(shiny) | |
library(rCharts) | |
library(ggplot2) | |
data(uspop2000, package = 'leaflet') | |
base_df <- head(uspop2000[which(uspop2000$State == "AL"), ]) | |
shinyServer(function(input, output){ | |
output$myChart <- renderMap({ |
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
require(ggplot2) | |
require(stringr) | |
d = as.vector(round(abs(10 * sapply(1:4, function(n)rnorm(20, mean=n, sd=.6))))) | |
ggplot(data=NULL, aes(x=1:length(d), y=d, col=cut(d,quantile(d)))) + | |
geom_point(size=5) + scale_colour_manual(values=rainbow(5)) | |
quantile_labels = function(d, qtls, units, round=2, minzero=F, maxplus=F, space=T){ | |
labs = levels(cut(d, qtls,include.lowest=T)) |
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
require(grid) | |
require(scales) | |
require(reshape2) | |
# Notes: | |
# dat should be a 3 column data.frame with fields in order as per example below | |
# wave wavyness of curves defined in terms of x axis data range - experiment to get this right | |
# ygap gap between items on each y axis | |
# col a single colour or vector of colours for categories when listed in alphabetical order | |
# leg.mode if true legend plotted in largest data observation, otherwise custom coordinates (leg.x/y [0,1]) |
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
require(alluvial) | |
require(reshape2) | |
d <- read.table(text="Class,1991,2003,2005,2009,2011,2013 | |
1,818,604,601,570,563,556 | |
2,183,147,145,143,142,150 | |
3,40,55,55,55,55,50 | |
4,48,70,81,76,85,99 | |
5,126,140,142,148,155,153 | |
6,396,566,568,566,525,508 |
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
require(shiny) | |
library(ggplot2) | |
shinyServer(function(input, output) { | |
datasetInput <- reactive({ | |
switch(input$dataset, | |
"rock" = rock, | |
"pressure" = pressure, | |
"cars" = cars) | |
}) |