Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| {"lastUpload":"2021-10-05T19:11:12.950Z","extensionVersion":"v3.4.3"} |
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(phonR) | |
| data(indoVowels) | |
| mapping <- c(a="eₐ", e="eₑ", i="eᵢ", o="eₒ", u="eᵤ") | |
| indo$label <- mapping[indo$vowel] | |
| png("subscripts-demo.png") | |
| with(indo, plotVowels(f1, f2, vowel, group=gender, plot.tokens=FALSE, plot.means=TRUE, pch.means=label, cex.means=2)) | |
| dev.off() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #!/usr/bin/env Rscript | |
| library(dplyr) | |
| library(ggplot2) | |
| library(ggbeeswarm) | |
| make_dollars <- function(x) paste0('$', prettyNum(x, big.mark=',')) | |
| ## load data | |
| sal <- read.delim('nih-postdoc-salary.tsv', sep='\t', header=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
| # 2 levels, treatment contrasts (default) | |
| # here, by luck, our baseline level happens to be alphabetically first, so we get a sensible | |
| # assignment of treatment=1. | |
| foo <- factor(c("treatment", "control")) | |
| contrasts(foo) | |
| # treatment | |
| # control 0 | |
| # treatment 1 | |
| # 2 levels, sum contrasts (better) |
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(phonR) | |
| data(indoVowels) | |
| indo$f1log <- log10(indo$f1) | |
| indo$f2log <- log10(indo$f2) | |
| f1hz <- seq(200, 1200, 100) # chosen based on range(indo$f1) | |
| f2hz <- seq(500, 3500, 500) # chosen based on range(indo$f2) | |
| png("log-scale-ellipses.png") | |
| with(indo, plotVowels(f1log, f2log, vowel, var.col.by=vowel, pretty=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(phonR) | |
| data(indoVowels) | |
| indo$f1bark <- normBark(indo$f1) | |
| indo$f2bark <- normBark(indo$f2) | |
| f1hz <- seq(300, 1200, 300) # chosen based on range(indo$f1) | |
| f2hz <- seq(500, 3500, 500) # chosen based on range(indo$f2) | |
| png("bark-scaled-hz-axis-ticks.png") | |
| with(indo, plotVowels(f1bark, f2bark, vowel, var.col.by=vowel, pretty=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(phonR) | |
| data(indoVowels) | |
| # just one talker, easier to see what's happening on the plot | |
| femaletwo <- subset(indo, subj == "F02") | |
| # simulate offglides, in F1 only (for simplicity) | |
| femaletwo$f1offglide <- femaletwo$f1 + sample(10:50, nrow(femaletwo), replace=TRUE) | |
| femaletwo$f2offglide <- femaletwo$f2 | |
| # remove offglides for vowel [a] (for demo purposes) |
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
| #!/usr/bin/env python2 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Feb 27 15:39:08 2017 | |
| @author: drmccloy | |
| """ | |
| from __future__ import print_function | |
| from expyfun import ExperimentController |