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
--- | |
title: "Standard Non-Standard Evaluation" | |
output: html_notebook | |
--- | |
```{r} | |
library(tidyverse) | |
``` |
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(shiny) | |
ui <- basicPage( | |
HTML("oma"), | |
numericInput("oma_one", "bottom", value = 0), | |
numericInput("oma_two", "left", value = 0), | |
numericInput("oma_three", "top", value = 0), | |
numericInput("oma_four", "right", value = 0), | |
plotOutput("plot1", | |
click = "plot_click", | |
dblclick = "plot_dblclick", |
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
--- | |
title: "Line Plot" | |
author: "Tim Mastny" | |
date: "7/9/2018" | |
output: github_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` |
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(rlang) | |
# from adv-r | |
partition_nameness <- function(lst) { | |
is_named <- names(lst) != "" | |
list( | |
named = lst[is_named], | |
unnamed = lst[!is_named] | |
) | |
} |
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
# curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
source ~/.git-prompt.sh | |
# save lots of history | |
export HISTFILESIZE=10000 |
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
.First <- function() { | |
# Sys.setenv(TZ = "America/Chicago") | |
options( | |
warnPartialMatchArgs = TRUE, | |
warnPartialMatchAttr = TRUE, | |
warnPartialMatchDollar = TRUE, | |
repos = c(CRAN = "https://cloud.r-project.org"), | |
servr.daemon = TRUE, | |
blogdown.author = "Tim Mastny", | |
usethis.full_name = "Timothy Mastny", |
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
# .R/Makevars | |
# debug unoptimized build | |
# CFLAGS += -g -O0 -Wall | |
# CXXFLAGS += -g -O0 -Wall | |
# CXX11FLAGS += -g -O0 -Wall | |
MAKE = make -j5 | |
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 | |
RLINK='/Library/Frameworks/R.framework/Resources/bin/R' | |
if [ -z "$*" ] | |
then | |
# /usr/local/bin/R --no-save --no-restore-data --quiet | |
$RLINK --no-save --no-restore-data --quiet | |
else | |
# /usr/local/bin/R "$@" | |
$RLINK "$@" | |
fi |
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 | |
open -a "RStudio" "$@" |
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
# http://sappingattention.blogspot.com/2018/06/meaning-chains-with-word-embeddings.html | |
cpath = function(matrix, w1, w2, blacklist = c()) { | |
p1 = matrix[[w1]] | |
p2 = matrix[[w2]] | |
base_similarity = cosineSimilarity(p1, p2) | |
pairsims = matrix %*% t(rbind(p1, p2)) | |
# Words closer to *either* candidate than the other word. These might be used eventually; mostly to save on computation in later steps. | |
decentsims = pairsims[apply(pairsims, 1, max) >= base_similarity[1],] |
OlderNewer