Table 1. Examples of 3 styles of code, each changing an object (such as a data frame or a vector), using 2 verbs (functions that manipulate that object), and 2 arguments specifying those verbs (such as applying that function to only section X of the object).
Sequential Syntax | Nested Syntax | Piped Syntax |
---|---|---|
object_step1 <- verb1(object, argument1)
object_end <- verb2(object_step1, argument2) |
object_end <- verb2( verb1(object, argument1 ), argument2 ) |
object_end <- object |> verb1(argument1) |> verb2(argument2) |