There's a lot to like about lisp: macros, the simple syntax, and the rapid development cycle. Most of the time, it is fine that we treat math operators like functions and use prefix notation, which is a consistent, function-first syntax.
This allows us to treat math operators the same as everything else so that we can pass them to reduce
, or anything else we want to do.
But we're not taught to read math expressions using prefix notation (with the operator first). Especially when formulas get even a little complicated, tracing out exactly what's happening can get hairy.
For this, we'll just need Incanter in our project.clj
file, so we'll use the dependencies statement—as well as the use
statement—from the Loading Clojure data structures into datasets recipe.
For data, we'll use the matrix that we created in the Converting datasets to matrices recipe.