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
| @article{Langsford2018quantify, | |
| title={Quantifying sentence acceptability measures: Reliability, bias, and variability}, | |
| author={Langsford, Steven, Perfors, Amy, Hendrickson, Andrew T, Kennedy, Lauren A., & Navarro, Danielle J.}, | |
| journal={Glossa: a journal of general linguistics}, | |
| volume={3}, | |
| number={1}, | |
| year={2018}, | |
| doi={http://doi.org/10.5334/gjgl.396} | |
| } |
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
| # build some sample data | |
| entries = 1000 | |
| data <- data.frame(nomem_encr = round(runif(entries, 100, 10000)), | |
| Cluster.x = sample(1:4, entries, replace=T), | |
| Cluster.y = sample(1:4, entries, replace=T)) | |
| # check that my sample data looks ok | |
| head(data) | |
| # get the unique cluster labels for each dimension |
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
| Target | Taxonomic | Thematic | Source | |
|---|---|---|---|---|
| SPOON | LADLE | CEREAL | GentnerBrem1999 | |
| ROCKET | MISSILE | ASTRONAUT | GentnerBrem1999 | |
| GARLIC | ONION | VAMPIRE | GentnerBrem1999 | |
| MILK | LEMONADE | COW | WisniewskiBassok1999 | |
| SHIP | CANOE | SAILOR | WisniewskiBassok1999 | |
| CAR | PICKUP TRUCK | MECHANIC | WisniewskiBassok1999 | |
| CHAIR | BED | CARPENTER | WisniewskiBassok1999 | |
| TELEPHONE | TAPE RECORDER | RECEPTIONIST | WisniewskiBassok1999 | |
| TIE | DRESS | MAN | WisniewskiBassok1999 |
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
| ``` | |
| $ Rscript --vanilla R/myscript.R 12 &> logs/myscript.log & | |
| ``` | |
| Rscript runs the .R file as a standalone script, without going into the R environment. | |
| The –vanilla flag means that you run the script without calling in your .Rprofile | |
| (which is typically set up for interactive use) and without prompting you to save a workspace image. | |
| I always run the Rscript from the save level to that which is set as the project root for Rstudio | |
| to avoid any problems because of relative paths being set up wrongly. | |
| The number after the .R file to be run is the number of cores you want to run the parallel stuff on. |
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
| require(ggplot2) | |
| agg_progress <- data.frame(id=rep(letters[1:10], each=6), | |
| Var1=rep(LETTERS[1:6], times=10), | |
| Freq=floor(100 * runif(60))) | |
| # As frequency | |
| ggplot(agg_progress) + theme_bw() + |
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
| # without | |
| "%w/o%" <- function(x, y) x[!x %in% y] | |
| # when an error occurs, invoke debug mode | |
| options(error = browser) | |
| # an R array produces a 1D JS array | |
| # an R list containing JS arrays (strings) produces a 2D JS array | |
| write.js.array <- function(l) { | |
| out <- "[" |
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 | |
| Rscript -e "library(knitr); knit('$1.Rmd')" | |
| pandoc -o $1.pdf $1.md |