I hereby claim:
- I am kaneplusplus on github.
- I am kaneplusplus (https://keybase.io/kaneplusplus) on keybase.
- I have a public key ASDluGe-p-mg79KbiEspTaL5ttVxqqt87OqICU0rRooebQo
To claim this, I am signing this object:
library(survival) | |
library(survminer) | |
library(patchwork) | |
library(ggplot2) | |
ggsurvsave <- function(filename, plot = last_plot(), ...) { | |
if (!inherits(plot, "ggsurvplot")) { | |
stop("Argument plot does is not a ggsurvplot object.") | |
} |
library(dplyr) | |
library(dbplyr) | |
library(uuid) | |
tmp_tbl <- function(x, con, tbl_name = UUIDgenerate()) { | |
uuid <- UUIDgenerate() | |
db_copy_to(con, tbl_name, as.data.frame(x), temporary = TRUE) | |
ret <- tbl(con, tbl_name) | |
ret$info <- new.env() | |
ret$info$con <- con |
library(sp) | |
library(raster) | |
setClass("coords", contains="matrix") | |
# x should be a matrix. The first column holds longitudes, the | |
# second holds latitudes. | |
coords <- function(x) { | |
if (!inherits(x, "matrix") && !inherits(x, "data.frame")) { | |
stop(paste0("Don't know how to make coordinates from an object ", |
I hereby claim:
To claim this, I am signing this object:
########################################### | |
# Install required packages. | |
########################################### | |
install.packages(c("iotools", "rbokeh", | |
"tidyr", "foreach", "doParallel", | |
"datadr", "trelliscope")) | |
# Download the Airline OnTime dataset. | |
url_prefix="http://stat-computing.org/dataexpo/2009/" |
soft_thresh = function(x, g) { | |
x = as.vector(x) | |
w1 = which(g >= abs(x)) | |
w2 = which(g < abs(x) & x > 0) | |
w3 = which(g < abs(x) & x < 0) | |
ret = x | |
ret[w1] = 0 | |
ret[w2] = x[w2]-g | |
ret[w3] = x[w3]+g | |
ret |
library(wordnet) | |
library(foreach) | |
get_synonyms = function(x) { | |
unique(foreach(pos=c("ADJECTIVE","ADVERB","NOUN","VERB"), .combine=c) %do% { | |
filter <- getTermFilter("ExactMatchFilter", x, TRUE) | |
ret = NULL | |
try({ | |
suppressWarnings({ | |
terms <- getIndexTerms(pos, Inf, filter) |
require(rredis) | |
redisConnect() | |
memoize <- function(expr, key=NULL, expire_time=Inf, verbose=FALSE, | |
envir=parent.frame()) { | |
if (is.null(key)) { | |
key <- paste(substitute(expr), collapse="") | |
} | |
if (redisExists(key)) { |
require(foreach) | |
require(itertools) | |
# block matrix multiplication | |
bmm <- function(x, y, chunkSize=max(1, floor(nrow(x)/6)), verbose=FALSE, | |
writeBlock=FALSE, returnResult=TRUE, filePrefix="block.", writeDir="", | |
projectionBlocks=FALSE) { | |
if (ncol(x) != nrow(y)) | |
stop("Non-conformable matrices") | |
if (verbose) { |