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
## BEAUTIFUL GULL MAPS! ## | |
# @srharacha on Twitter: https://twitter.com/srharacha/status/1662648523597418501?s=20 | |
# Step 1: download the data | |
# We're going to download study number 986040562, our | |
# herring gull data, using the `move` package. You'll | |
# need a Movebank username and password to download it. | |
library(move) | |
# We only want to download the track for one bird - the |
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
# Interactive Wild Turkey (Meleagris gallopavo, B-WITU) map | |
# 00 SETUP ==== | |
library(magrittr) # for %>% | |
# Set up reproducible renv environment so anyone using this code | |
# will achieve the same result, regardless of machine | |
# This means any libraries I download now will also be downloaded |
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
from contextlib import closing | |
from io import StringIO | |
from time import time | |
import pandas as pd | |
from django.core.management.base import BaseCommand | |
from django.db import transaction | |
from faker import Faker | |
from core.models import Thing |
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
## Example procedure for working with data (attributes) inside SpatialPolygonsDataFrame objects | |
# Load my favorite libraries for that sort of work | |
library(data.table) | |
library(rgdal) | |
# Load 2 shapefiles that, say, we want to merge. | |
# Note that you can read pretty much any spatial format using readOGR(). | |
tza.l2 <- readOGR("./analysis/TZA-AC-07/maps", "tza-ac-07_L2") | |
tza.l1 <- readOGR("./analysis/TZA-AC-07/maps", "tza-ac-07_L1") |
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
# ====================================================================================== | |
# Create a simple world map in Robinson projection with labeled graticules using ggplot | |
# ====================================================================================== | |
# Set a working directory with setwd() or work with an RStudio project | |
# __________ Set libraries | |
library(rgdal) # for spTransform() & project() | |
library(ggplot2) # for ggplot() |