Skip to content

Instantly share code, notes, and snippets.

View rBatt's full-sized avatar

Ryan Batt rBatt

  • TRM Labs
  • New York, New York
View GitHub Profile
@rBatt
rBatt / gist:b4bfba056e7cf1bec55a
Last active September 22, 2015 16:20
multiply 2d kernel by this
# this is what 'test' looks like:
# > test
# s.reg year num nameID stratum lon lat btemp depth N Nsite spp Z u.a0 a1 a2
# 1: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Acantholithodes hispidus 0 -2.807526 0.60290095 -0.1560553
# 2: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Acantholumpenus mackayi 0 -4.294548 0.66363085 -0.1244255
# 3: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Actinauge verrilli 0 -2.763588 0.67887606 -0.1261046
# 4: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Admete regina 0 -3.658542 0.66688800 -0.1661476
# 5: ebs 1982 12 ebs_1982_12 -158.5 57.5 -158.5 57.5 -0.16 34.4 919.4999 83 Aforia circinata 0 -9.954288 0.67970755 -0.1168343
# ---
@rBatt
rBatt / fig.setup.R
Last active January 11, 2016 20:37
png(file="~/Desktop/figure.png", width=3.5, height=3.5, res=150, units="in") # open / setup device
par(
mar=c(1.75, 1.75, 0.1, 0.1), # panel magin size in "line number" units
mgp=c(1, 0.1, 0), # default is c(3,1,0); line number for axis label, tick label, axis
tcl=-0.1, # size of tick marks as distance INTO figure (negative means pointing outward)
cex=1, # character expansion factor; keep as 1; if you have a many-panel figure, they start changing the default!
ps=8, # point size, which is the font size
family="sans"
@rBatt
rBatt / gist:7ae49c0f216d430906ca
Last active August 29, 2015 14:20
Lake Metabolizer Latex Scripts
% ===============
% = Bookkeeping =
% ===============
% Equation 3: average respiration
R_{\mu} = \frac{\sum\limits_{i=1}^{n} \Delta DO_i - F_i}{n \Delta t}
NEP = \frac{NEP_t (\text{mg O}_2 \text{ L}^{\text{-}1} \Delta t)} {1}