Skip to content

Instantly share code, notes, and snippets.

View natemiller's full-sized avatar

Nate Miller (he/him) natemiller

View GitHub Profile

Challenge

I long struggled with a convenient means of adding images, primarily logos, to maps and charts made in ggplot. All the approaches just seemed clunky, it was hard to size the and place the logo, or clipping had to be turned off, or the plot had to be saved and then reloaded to add the logo.

Then I came across the ggpmisc package by Pedro Aphalo

@natemiller
natemiller / 2018-07-19_ICCAT_observer_comparison.md
Last active July 30, 2018 04:56
GFW/ICCAT Observer Data Comparison

ICCAT Observer Data Comparison

The ICCAT tuna RFMO provides some high resolution observer data in the 2016 report (obtained from https://www.iccat.int/Documents/Comply/transhipmentreports_current.pdf). The data contained in this report was extracted and processed to determine how well GFW encounters and loitering events match to actual reported fish transshipments. While the maps below show the patterns for supply transshipments as well the current analysis did not consider the matching of encounters or loitering to these events, though it is apparent (from the maps) that in some cases, and for some vessels, supply transshipments also align.

What follows are some basic analysese of the dataset and then a series of maps for each transshipment/carrier vessels for each voayage documented within the ICCAT observer report. On each map I have shown the location of reported/observed transshipments of catch and observed transshipments of supplies. Along side these reported data, I have provided those events

@natemiller
natemiller / index.html
Created May 12, 2016 02:00
Climate Change Topic Modeling - Topic 8
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 8</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 02:01
Climate Change Topic Modeling - Topic 7
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 7 </title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 01:57
Climate Change Topic Modeling - Topic 6
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 6</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 01:54
Climate Change Topic Modeling - Topic 5
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 5</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 01:49
Climate Change Topic Modeling - Topic 4
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 4</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 01:44
Climate Change Topic Modeling - Topic 3
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 3 </title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / index.html
Last active May 12, 2016 01:36
Climate Change Topic Modeling Topic 2
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<title> Climate Streamplot - Topic 2</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style type = 'text/css'>
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / README.md
Last active May 16, 2016 02:33
Climate Change Topic Modelling

After obtaining articles from the New York Times that included the phrases 'climate change' and 'global warming' between 1988 - 2016, Dynamic Topic Modeling was applied to search for shifts in the discussion of climate change over time. Analyses were performed using the Python package 'gensim', which provides a wrapper for a C+ based program based on that originally developed by David Blei (https://radimrehurek.com/gensim/models/wrappers/dtmmodel.html). A total of 8 coherent topics were identified and labled. The top 10 words from each year were then identified and used to generate streamplots using d3.js.

Streamplots aren't the perfect visualization, but they do provide a useful means of assessing the general importance of particular words within each topic and how the use of those words, within that topic, and within the broader umbrella of "Climate Change' has shifted over time.