On this page:
Sawzall:   A grammar for chopping up data
8.13.0.2

Sawzall: A grammar for chopping up data🔗ℹ

 (require sawzall) package: sawzall-lib

Sawzall is a grammar for manipulating data, and provides a set of primitives that allow solving common data-manipulation problems in a style similar to spreadsheets. Sawzall uses the data-frame library as its primary object of input and output, and is designed to manipulate these data-frames.

Sawzall is designed around tidy data, but most data found in the wild will not be tidy. For more information, see Pivoting.

Sawzall is designed with the threading library in mind. While it is possible to use without it, most operations will be more natural expressed with ~>.

Many examples in this documentation will be based around the following simple frame:
> (define example-df
    (row-df [grp trt adult juv]
             "a" "b" 1     10
             "a" "b" 2     20
             "b" "a" 3     30
             "b" "b" 4     40
             "b" "b" 5     50))

    1 Constructing data-frames

    2 Displaying data

    3 Grouping and splitting

      3.1 Grouping

      3.2 Splitting

    4 Filtering

    5 Slicing

    6 Creating and modifying columns

    7 Summarizing

    8 Joining

      8.1 Combining joins

      8.2 Filtering joins

    9 Sorting

    10 Pivoting

    11 Separating variables

    12 Unnesting

    13 Missing values