Skip to content

Instantly share code, notes, and snippets.

@floybix
floybix / transitive_dependencies.r
Created September 12, 2013 04:32
Find all transitive dependencies of an R package.
## find all transitive dependencies of an R package.
distrib.pkgs <- library(lib.loc=R.home("library"))$results[,1]
dependencies <-
function(pkg, dependencies = c("Depends", "Imports", "LinkingTo"),
pl = installed.packages())
{
if (!(pkg %in% rownames(pl))) stop("unknown pkg " pkg)
fields <- pl[pkg, dependencies]
@floybix
floybix / xtable_printbold.R
Created June 25, 2010 00:23
Highlights cells, such as the maxima in each column or row, of an 'xtable' in R
## 2010-06-25
## (c) Felix Andrews <felix@nfrac.org>
## GPL-2
## If 'which' is given it should be a logical matrix specifying bold cells.
## Otherwise: in each column or row with numeric data, the maximum or minimum
## value is set bold; 'max' can have entries for each column/row, NA means skip.
## Examples:
## library(xtable)
@floybix
floybix / papers.md
Created February 14, 2017 06:12
Papers read, reading, to read
@floybix
floybix / core.clj
Created February 14, 2017 02:05
GRN (gene regulatory network) experimental discrete formulation
(ns org.nfrac.gron.core
(:require [clojure.spec :as s]
[clojure.spec.gen :as gen]))
(s/def ::sep #{-1})
(s/def ::base (-> nat-int?
(s/with-gen #(s/gen (s/int-in 0 10)))))
(s/def ::seq-gene
;; gorilla-repl.fileformat = 1
;; **
;;; # Forecasting NYC taxi passengers
;; **
;; **
;;; _Felix Andrews_
;;;
;;; Adapted from part of Marcus Lewis' [Predicting power consumptions with HTM](http://mrcslws.com/gorilla/?path=hotgym.clj).
@floybix
floybix / .emacs
Created July 20, 2011 13:05
Emacs support for R embedded in HTML (using brew R package)
;;; support for 'brew' as a mixture of R and HTML
(load-file "~/.emacs.d/multi-mode.el")
(load-file "~/.emacs.d/html-brew.el")
(add-to-list 'auto-mode-alist '("\\.brew\\'" . html-brew-mode))
@floybix
floybix / 00_init.R
Created August 11, 2010 07:13
groundwater database analysis scripts
## groundwater database analysis scripts
## Felix Andrews <felix@nfrac.org> 2010-08-01
library(RODBC)
library(zoo)
library(lattice)
library(latticeExtra)
library(sp)
library(rgdal)
@floybix
floybix / keybase.md
Created January 19, 2015 13:52
keybase.md

Keybase proof

I hereby claim:

  • I am floybix on github.
  • I am floybix (https://keybase.io/floybix) on keybase.
  • I have a public key whose fingerprint is E30E DF10 BE74 4A87 3E82 3B98 29A6 F488 A82A 820C

To claim this, I am signing this object:

@floybix
floybix / save_restore_state.logo
Created October 30, 2014 05:06
saving and restoring turtle state