The R Formula Cheatsheet

R’s formula syntax is extremely powerful but can be confusing for beginners. 1 This post is a quick reference covering all of the symbols that have a “special” meaning inside of an R formula: ~, +, ., -, 1, :, *, ^ , and I() . You may never use some of these in practice, but it’s nice to know that they exist. It was many years before I realized that I could simply type y ~ x * z instead of the lengthier y ~ x + z + x:z , for example. While R formulas crop up in a variety of places, they are prob