R

A tutorial on generalized additive mixed-effects model (GAMM)

Preliminaries: The challenge of dynamic data Phonetics used to concern mostly with static data, such as VOT, formant values at vowel midpoint, or F0 at vowel onset. But as computers are getting more and more powerful, it is common (almost a necessity) to analyze dynamic data. For example, instead of F0 at vowel onset, pitch contour during the voiced parts needs to be analyzed, and similarly, formant trajectories are analyzed instead of formant values at
2024-04-28
5 min read

How to define aesthetic mappings of ggplot2 within another function

ggplot2 is great for visualization, but sometimes we need to include ggplot2 functions within another function. ggplot() uses aes() to define aesthetic mappings of different variables. The question is: how to define aesthetic mappings when writing functions using ggplot()? In this post I will present several approaches. First of all, let’s load the required packages and some test data. library(ggplot2) library(dplyr) data("mtcars") Using aes_string() There are two standard ways to define aesthetic mappings in ggplot2,
2020-03-28
1 min read