This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized (dark)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains 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
// try and handle labels over-writing by altering the label position | |
// pos_gap is a variable that controls how close two labels must be before the position is changed | |
// it can only handle a series of 3 overlapping labels | |
// the first is assigned up a clock position | |
// the second is assigned down a clock positon | |
local pos_gap 0.1 | |
bys this_icode (percent): replace pos = pos + 1 /// | |
if abs(percent[_n] - percent[_n+1]) < `pos_gap' /// | |
& pos[_n] == pos[_n+1] | |
bys this_icode (percent): replace pos = pos - 1 /// |
This file contains 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
// Log | |
// === | |
// 140607 - cloned from demo keybindings.ftplugin | |
define(function(require, exports, module) { | |
'use strict'; | |
var Extensions = require('ft/core/extensions').Extensions; | |
Extensions.addInit(function (editor) { |
This file contains 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
#! /usr/bin/python | |
# author: Steve Harris | |
# Convert short nvAlt image links to full path for previewing in Marked | |
# Todo | |
# ==== | |
# - move the pathto line to a variable | |
# - post this script as a gist |
This file contains 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
var dataset; // declare a global var to hold data | |
d3.csv("data/univar.csv", function(error, data) { | |
if(error) { | |
console.log(error); | |
} | |
else { | |
console.log(data); | |
} |
This file contains 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
time24_regex = re.compile( r"""\b ([01]?\d|2(?=[0-3])\d) [:|.]? ([0-5]?\d) \b""", re.VERBOSE) |
This file contains 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
# Test data: 1000 patients with two different age distributions | |
tdt <- data.table(age.old=rnorm(1000, mean=65, sd=15), age.young=rnorm(1000,mean=55,sd=10)) | |
# Function to compare two distributions using qplot | |
qqplot <- function(x,y, data=wdt, n=100) { | |
lab.x = x | |
lab.y = y | |
x <- with(data, get(x)) | |
x <- sapply(seq(0,1,1/n), function(q) quantile(x, q, na.rm=TRUE)) | |
y <- with(data, get(y)) |
This file contains 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
score.charlson <- function(data) { | |
# data is a datatable containing the columns you need | |
# identify the columns with pmh in the name | |
require(data.table) | |
charlson.values <- data[,.(pmhmi, pmhhf, pmhpvd, pmhcvd, pmhdem, pmhcopd, pmhcopd, pmhctd, pmhud, pmhmld, pmhdm, pmhhemi, pmhckd, pmhdmend, pmhtumour, pmhleuk, pmhlymph, pmhsld, pmhmets, pmhaids)] | |
charlson.matrix <- as.matrix(charlson.values) | |
# Now I need to convert the NA's to 0 and >0 to 1 in matrix | |
charlson.matrix <- apply(charlson.matrix, 2, function(x) ifelse(is.na(x), 0, ifelse(x>=1,1, 0))) | |
# Now create a vector of scores | |
# Note that the order of the columns selected above *must* match the order of the scores here |
This file contains 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
gen.sofa.c <- function(bpsys, bpdia, rxcvs_drug=NULL, rxcvs_dose=NULL) { | |
rx1 <- c("Adrenaline", "Noradrenaline") | |
rx2 <- c("Dopamine") | |
rx3 <- c("Vasopressin") | |
rx <- c(rx1, rx2, rx3, "Other") | |
# Print these descriptions so you know what you have passed to the function | |
bpmap <- round(bpdia + (bpsys - bpdia) / 3) |
This file contains 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
/* | |
## Create a rug plot | |
_____________________ | |
CreatedBy: Steve Harris | |
CreatedAt: 111291 | |
ModifiedAt: 120701 | |
Log |
OlderNewer