Skip to content

Instantly share code, notes, and snippets.

View dschwilk's full-sized avatar

Dylan Schwilk dschwilk

View GitHub Profile
# data-cache.R
# provides the get_data() function that allows efficient loading of data that
# is time-consuming to read from disk, transform or clean. We have several
# data sources (ascii gis grids, iButton time series, etc) which take
# considerable porcessing time to load and transform to a useful format. But
# we also only want to store the raw data and code in git, not the
# intermediate useful forms. So the solution is to store the intermediate forms
# as .rds objects in a directory ignored by git. Then if those rds files do not
# exist already (and, optionally, if the source data is newer than the rds
@dschwilk
dschwilk / thunderlink-capture.js
Last active October 27, 2020 18:51
Javascript code snippets for mozzilla thunderbird org-mode links. Allows easy insertion of links to thunderbird email messages in org-mode for emacs.
@dschwilk
dschwilk / BarkContour.R
Last active October 1, 2020 15:13
MORE COMPLETE CODE WITH DATA AT https://github.com/schwilklab/bark-contour. R script to read digitized bark contours and calculate bark thickness distributions. See Schwilk, D.W., M. Gaetani and H.M. Poulos. 2013. Oak bark allometry and fire survival strategies in the Chihuahuan Desert Sky Islands, Texas, USA. PLoS One: 8(11) e79285. DOI: 10.137…
## R code to calculate bark thickness distributions from a digitized contour
## D.W. Schwilk 2013
## (See Adams and Jackson 1995 for description of the method)
SSPAR = 0.7
library(ggplot2)
library(plyr)
library(grid)