Posts

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

Writing Praat scripts in a modular way

Praat is widely used in phonetic research. Working with Praat involves inevitably the Praat scripting. There are plenty of resources of Praat scripts as well as great tutorials to Praat scripting (see below). Why bother writing Praat scripts oneself? Praat scripts written by others can be helpful, but even an script is available which offer the functionality one needs, it is seldom exactly what one wants. It is normal to do some tailoring to the
2019-12-06
3 min read

用pandoc生成大型中文文档的痛点与解决方案

Pandoc是转换文本格式的利器。在用 Pandoc 转换中文文档和生成大型文档时,例如用中文写作毕业论文等时,会遇到一些很麻烦的问题。我在前面的博客里说过我在用 Markdown
2019-11-25
6 min read