Skip to content

Instantly share code, notes, and snippets.

View jamesgrecian's full-sized avatar

James Grecian jamesgrecian

View GitHub Profile
@jamesgrecian
jamesgrecian / extract NSIDC.r
Last active June 12, 2018 15:08
Extract NSIDC geotiff data to points
############################################
### Extract NSIDC geotiff data to points ###
############################################
#Many thanks to mdsumner for help with this:
#https://github.com/mdsumner/extractNSIDC/blob/master/extract_script.R
#Load libraries
require(tidyverse)
require(lubridate)
@jamesgrecian
jamesgrecian / habitat preference gam.r
Last active August 15, 2018 20:40
Example script to generate habitat preference GAM using telemetry data and random pseudo-absence points
#####################################################
### Some pointers for habitat preference analysis ###
#####################################################
#Load in libraries
require(sf)
require(tidyverse)
require(viridis)
require(rworldmap)
require(raster)
@jamesgrecian
jamesgrecian / animation.r
Last active April 16, 2019 01:52
Animate animal movement tracks
##########################################
### Example script to animate GPS data ###
##########################################
# Load libraries
require(tidyverse)
require(animation)
require(viridis)
require(rworldmap)
require(sf)
@jamesgrecian
jamesgrecian / kernel.r
Created July 17, 2018 13:39
Example script to generate a bivariate kernel from telemetry data using adehabitat
#####################################################################################################
### Example script to generate and plot a bivariate kernel utilisation distribution from GPS data ###
#####################################################################################################
# Load libraries
require(tidyverse)
require(viridis)
require(rworldmap)
require(sf)
require(raster)
@jamesgrecian
jamesgrecian / Generate map wedge in ggplot.r
Last active June 12, 2019 17:35
Example script to generate a map using ggplot2 with similar look to Ocean Data View
###########################################################################################
### Example script to generate a map using ggplot2 with similar look to Ocean Data View ###
###########################################################################################
# The example map I am trying to recreate is here:
# https://twitter.com/JamesGrecian/status/1137018574504153089?s=20
# Load in libraries
require(marmap) # for bathymetry data
require(tidyverse)
@jamesgrecian
jamesgrecian / globcolour_download
Created April 13, 2021 15:57
Example script for globcolour chl-a data download
###################################################
### Download globcolour.info data from ftp site ###
###################################################
# Load libraries
require(raster)
require(tidyverse)
# first request data from https://hermes.acri.fr/index.php?class=archive
# then emailed ftp site address
@jamesgrecian
jamesgrecian / cookie_map.r
Last active June 23, 2022 12:42
Create a circular map of the Southern ocean using ggplot2