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 / scatterLine.R
Last active April 7, 2017 01:12
Scatter Plot with per-subset regression lines
#' Scatter plot with certain groups of points getting own regression and fitted line
#'
#' @param Data a data.table
#' @param x,y,lineBy character, name of column in \code{Data}
#' @param ptCol,lineCol character or quoted expression (call) for point or line color, repsectively
#' @param ... arguments to be passed to \code{\link{plot}} and \code{link{lines}}
#'
#' @examples
#' dt <- data.table(
#' x=x<-rnorm(9, sd=2), # why <- is better than =
x = arima.sim(model=list(ar=0.9), n=200)
acf(x)
pacf(x
@rBatt
rBatt / LM_mbkkp_test.R
Last active March 27, 2018 17:25 — forked from cbuelo/LM_mbkkp_test.R
LakeMetabolizer meta.bookkeep() example
#Test case for calculating metabolism
library(LakeMetabolizer)
#set up test example where DO starts and ends at same level, is at saturation (= no flux)
DOobs = c(3, 2, 3, 4, 3, 2)
DOsat = c(3, 2, 3, 4, 3, 2)
kGas = c(.2, .2, .2, .2, .2, .2)
zMix = c(1, 1, 1, 1, 1, 1)
irr = c(0, 1, 1, 0, 0, 0)