This file contains hidden or 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
rm -rf ~/.rstudio | |
rstudio-server kill-all |
This file contains hidden or 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
Reduce(function(x, y) merge(x, y, all=TRUE), list(df1, df2, df3)) | |
# OR # | |
Reduce(function(...) merge(..., all=TRUE), list(df1, df2, df3)) |
This file contains hidden or 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 sensitivity curve of coefficient estimates | |
library(tidyverse) | |
library(cowplot) | |
library(fastDummies) | |
# Setup ---- | |
rm(list = ls()) | |
theme_set(theme_cowplot()) | |
set.seed(42) |
This file contains hidden or 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
multipetal <- function(df, n) { | |
varname <- paste("petal", n , sep=".") | |
mutate(df, !!varname := Petal.Width * n) | |
} |
This file contains hidden or 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
points.shp <- points.shp[apply(sf::st_intersects(points.shp, polys), 1, any),] |
This file contains hidden or 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
my.summary = function(x) list(mean = mean(x), median = median(x)) | |
DT[, as.list(unlist(lapply(.SD, my.summary))), .SDcols = c('a', 'b')] | |
This file contains hidden or 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
x <- c(5, 15, 2015) | |
sprintf(sprintf("%03d", x)) |
This file contains hidden or 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
## Logging into server | |
ssh <server-address> | |
# Login | |
tmux | |
# CTRL-b d to detach tmux | |
exit | |
## When returning to server | |
tmux attach |
This file contains hidden or 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
library(tinytex) | |
tlmgr_search('/times.sty') # search for times.sty | |
tlmgr_install('psnfss') # install the psnfss package | |
tlmgr_update() # update everything |
This file contains hidden or 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
#!/bin/bash | |
DATE=`date "+%A, %b %d %Y"` | |
YESTERDAY=`date -v-1d "+%A, %b %d %Y"` | |
open "bear://x-callback-url/create?title=$DATE&text=## Beginning of day thoughts | |
## Goals | |
- | |
## End of day thoughts | |
[[$YESTERDAY]]&tags=dailylog" |
NewerOlder