Skip to content

Instantly share code, notes, and snippets.

View ccamara's full-sized avatar

Carlos Cámara ccamara

View GitHub Profile
@ccamara
ccamara / sample-ggplot.R
Created February 28, 2017 13:10
Annotation in #R #ggplot
# Source: http://sharpsightlabs.com/blog/simple-annotate-plot-ggplot2/
ggplot(df, aes(x = Año, y = Población, group = 1)) +
geom_line(colour = "red", size = 1.5) +
geom_point(colour = "red", size = 4, shape = 21, fill = "white") +
geom_text(aes(label = Año), size = 3, hjust = 0.5, vjust = 3, position = "stack") +
scale_y_continuous(labels = function(x) format(x, big.mark = ".", scientific = FALSE)) +
ggtitle("Evolución de población en Detroit") +
labs(x = "Año", y = "Población") +
geom_vline(xintercept = 1973, linetype = "dashed") +
@ccamara
ccamara / README.md
Created June 14, 2018 11:39 — forked from jsanz/README.md
MapboxGL + OSM data

Simple script to get data (nodes and polygons separately) from OSM using Overpass API and render it on a Mapbox GL map.

This is probably a work in progress.

To do:

  • Work on having to do just a single call to the Overpass API and then split the geometries by type.
  • Better styling
  • Popups?
CCAA date total
1 Andalucía 16-03-20 0
2 Andalucía 17-03-20 0
3 Andalucía 18-03-20 38
4 Andalucía 19-03-20 33
5 Andalucía 20-03-20 72
6 Andalucía 21-03-20 72
7 Andalucía 22-03-20 38
8 Aragón 16-03-20 0
9 Aragón 17-03-20 0