Skip to content

Instantly share code, notes, and snippets.

View javimarlop's full-sized avatar

Martinez-Lopez Javier javimarlop

View GitHub Profile
@marcosci
marcosci / street_orientation.R
Created May 10, 2023 12:36
street_orientation
# load libraries
library(tidyverse)
library(osmdata)
library(sf)
library(ggtext)
library(exactextractr)
library(fasterize)
library(ggtext)
library(tidygeocoder)
library(glue)
@jebyrnes
jebyrnes / leafletMap.R
Last active August 8, 2022 14:13
Basic leaflet mapping in R
#Load the library and make a basic map
library(leaflet)
leaflet() %>% addTiles()
#Show a map with a satellite picture on it
leaflet() %>%
addTiles(urlTemplate="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}")
#Make a demo fake data set
#!/usr/bin/env python
import psycopg2 as pg
import Image
from sys import argv
conn = pg.connect(database='tweets', user='char', host='localhost')
cur = conn.cursor()
pxper = 16
@aaronwolen
aaronwolen / slides.md
Last active November 11, 2022 23:57
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@gufodotto
gufodotto / server.R
Last active December 11, 2015 15:18
First Shiny webapp - Lorentz equation
library(shiny)
library(deSolve)
library(ggplot2)
# Define server logic required to plot various variables
shinyServer(function(input, output) {
solveLorenz <- function(pars, times=tout) {
derivs <- function(t, state, pars) { # returns rate of change
with(as.list(c(state, pars)), {
@mbostock
mbostock / .block
Last active May 12, 2024 22:19
Force-Directed Graph
license: gpl-3.0
height: 600
redirect: https://observablehq.com/@d3/d3-force-directed-graph
@geotheory
geotheory / gist:1869673
Created February 20, 2012 15:28
Simplifying spatial polygons in R {rgeos}
library(rgeos)
data(wrld_simpl)
plot(wrld_simpl, col='white', bg='grey9', border=NA)
limx <- c(-6,1)
limy <- c(49,60)
plot(wrld_simpl, xlim=limx, ylim=limy, col='white', bg='grey9', border=NA)
# Apply RDP algorithm with distance variable = 0.4 degrees