Increasing quantities of and access to both wildlife survey data and non-designed incidental or citizen science data have left us with a rather big problem: how to we put all of these disparate pieces together and build species distribution models that use as much of the available data as possible? This leads us to a series of sub-questions that I will address in this talk: should we combine data then model it all at once or, build multiple models and figure out how to combine their outputs (or couple their fitting)? How can we find equivalences in recorded effort (and what can we do when no effort is recorded)? I'll illustrate these issues and offer some solutions using example data from aerial and shipboard surveys of seabirds in New England, as well as from large-scale surveys of marine mammals in the North Atlantic.
This file contains hidden or 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
# is Columbus, OH really the only place in the US where you're within | |
# 500 miles of half of the US population? | |
# claim: https://448f59f74df57015bbb8-a9447b7dfa4ae38e337b359963d557c4.ssl.cf3.rackcdn.com/9987%20Brewdog%20EFP%20Prospectus%20USA%20A4%20v9.pdf | |
# "Columbus is within 500 miles of over half of the US population" | |
# get the US 2010 census data | |
# http://www2.census.gov/geo/docs/reference/cenpop2010/county/CenPop2010_Mean_CO.txt | |
cent <- read.csv("CenPop2010_Mean_CO.txt") |
This file contains hidden or 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
library(ggplot2) | |
library(emoGG) | |
source("imgcat.R") | |
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_emoji(emoji="1f337") | |
imgcat(print(p)) |
This file contains hidden or 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
# little animation to illustrate uncertainty in a density map | |
library(dsm) | |
library(mvtnorm) | |
library(ggplot2) | |
library(animation) | |
library(viridis) | |
# load the models and prediction data | |
# using data from the Duke spatial distance sampling course |
This file contains hidden or 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
# overlap of: | |
# - US state 2 letter codes from state.abb in R | |
# - 2-letter Scrabble words https://en.wiktionary.org/wiki/Appendix:Official_English_Scrabble_2-letter_words | |
# - chemical element symbols https://en.wikipedia.org/wiki/Symbol_%28chemistry%29 | |
# get data | |
states <- tolower(state.abb) | |
scrabble <- c('aa','ab','ad','ae','ag','ah','ai','al','am','an','ar','as','at','aw','ax','ay','ba','be','bi','bo','by','ch','da','de','di','do','ea','ed','ee','ef','eh','el','em','en','er','es','et','ex','fa','fe','fy','gi','go','gu','ha','he','hi','hm','ho','id','if','in','io','is','it','ja','jo','ka','ki','ko','ky','la','li','lo','ma','me','mi','mm','mo','mu','my','na','ne','no','nu','ny','ob','od','oe','of','oh','oi','om','on','oo','op','or','os','ou','ow','ox','oy','pa','pe','pi','po','qi','re','sh','si','so','st','ta','te','ti','to','ug','uh','um','un','up','ur','us','ut','we','wo','xi','xu','ya','ye','yo','yu','za','zo') | |
elements <- tolower(c('Ac','Ag','Al','Am','Ar','As','At','Au','B','Ba','Be','Bh','Bi','Bk','Br' |
This file contains hidden or 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
### blah | |
library(exif) | |
# get the files | |
files <- dir(".", full.names=TRUE) | |
files <- files[grepl(".JPG", files)] | |
# get the data | |
exifs <- read_exif(files) |
This file contains hidden or 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
# you need my horse library from here: https://github.com/dill/horse | |
library(horse) | |
library(magrittr) | |
library(knitr) | |
setup_twitter_oauth("you auth stuff", | |
"goes here", | |
"you can't use mine", | |
"it's mine") |
This file contains hidden or 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
# cyclic-random effects tensor for Noam | |
library(mgcv) | |
# code adapted from ?gam.model | |
dat <- gamSim(1,n=400,scale=2) ## simulate 4 term additive truth | |
## Now add some random effects to the simulation. Response is | |
## grouped into one of 20 groups by `fac' and each groups has a | |
## random effect added.... |
This file contains hidden or 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
# convert mp4 to gif | |
# converts in.mp4 to out.gif, using 0-20s of the mp4 at resolution 640x480 | |
ffmpeg -ss 00:00:00.000 -i in.mp4 -pix_fmt rgb24 -r 10 -s 640x480 -t 00:00:20.000 out.gif | |
# alternative mp4 to gif (using imagemagick for the second step) | |
ffmpeg -i input.mp4 -r 10 output%05d.png | |
convert output*.png output.gif | |
# strip audio out of a video file (to aac) |
This file contains hidden or 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
library(emoGG) | |
library(ggplot2) | |
# set the am variable to be different emoji | |
mtcars$am[mtcars$am==1] <- "1f697" | |
mtcars$am[mtcars$am==0] <- "1f68c" | |
# use am as the emoji aesthetic | |
ggplot(mtcars, aes(wt, mpg, emoji=am))+ geom_emoji() |