I hereby claim:
- I am klmr on github.
- I am klmr (https://keybase.io/klmr) on keybase.
- I have a public key whose fingerprint is C50E C91D 5CB6 5576 F218 02A7 819B 7ADF DFF6 82BE
To claim this, I am signing this object:
# Command line tools don’t want to clutter their output with unnecessary noise. | |
library = function (...) | |
suppressMessages(base::library(...)) | |
#' The command line arguments | |
args = commandArgs(trailingOnly = TRUE) | |
#' The name of the script | |
#' | |
#' @note If the script was invoked interactively, this is the empty string. |
library(dplyr) | |
counts = data.frame(Gene = c('A', 'B', 'C', 'D'), | |
Length = 1:4, | |
do1 = c(10, 20, 30, 40), | |
do2 = c(20, 40, 60, 80), | |
do3 = c(20, 20, 30, 40)) | |
tpm = counts %>% | |
mutate_each(funs(. / Length), starts_with('do')) %>% |
package demo; | |
public class Numbers { | |
static final String hexDigits = "0123456789ABCDEF"; | |
static final String decDigits = "0123456789"; | |
static int fromBaseRepresentation(final String value, final String digits) { | |
final int base = digits.length(); | |
int result = 0; | |
for (final char c : value.toCharArray()) { |
#!/usr/bin/env Rscript | |
options(stringsAsFactors = FALSE) | |
library(dplyr) | |
library(ggplot2) | |
library(jsonlite) | |
# Usage: | |
# ./tagviews.r datafile.json output.png | |
args = commandArgs(TRUE) |
I hereby claim:
To claim this, I am signing this object:
`^` = function (a, b) UseMethod('^') | |
`^.default` = .Primitive('^') | |
`^.character` = function (str, n) paste(rep(str, n), collapse = '') | |
'ho' ^ 3 | |
# "hohoho" |
memoize = function (f) { | |
force(f) | |
cache = new.env() | |
function (...) { | |
key = capture.output(dput(list(...))) | |
if (key %in% ls(cache)) | |
return(get(key, envir = cache)) | |
value = f(...) | |
assign(key, value, envir = cache) |
library(biomaRt) | |
ensembl = useMart('ensembl', dataset = 'mmusculus_gene_ensembl') | |
seq = getBM(c('ensembl_gene_id', 'ensembl_transcript_id', 'coding'), | |
filters = 'external_gene_name', values = 'HAT1', mart = ensembl) | |
head(seq, 1) |
{ | |
"Browse Mode" = 3; | |
CalSuccessfulLaunchTimestampPreferenceKey = "3.580207e+08"; | |
"Calculator Results Display" = 1; | |
"Check for Update Frequency" = 1; | |
"Check for Updates" = 1; | |
"Delay Before Quitting" = 1; | |
"Hide Dock Icon" = 1; | |
"Last Update Check" = "2014-10-22 16:06:08 +0000"; | |
"Last Used Location" = "/Applications/Quicksilver.app"; |
read.table = function (file, ..., text) { | |
args = list(...) | |
if (missing(file)) | |
return(do.call(utils::read.table, c(args, text = text))) | |
if (! ('sep' %in% names(args))) { | |
separators = list('.csv' = ',', | |
'.tsv' = '\t', | |
'.txt' = '\t') | |
extension = stringr::str_match(file, '(\\.\\w+)$')[, 2] |