I’ve just discovered a unique app on the Mac App Store called Calca. It’s like a simple word-processor, except you can define variables and functions and do arithmetic with them, and it understands units and currencies and it handles matrices and vectors, and supports basic Markdown, and … it’s pretty amazing.
Notice in the above screenshot that variables can naturally contain spaces in their names, without the need to put quotation marks around them. To display a value or calculation, put “=>” after it, and Calca displays the resulting value in a grey box. Type unindented text and Calca figures out that it’s not calculations and formats it as text.
Of course, everything is dynamic, so if you change a variable, all the results throughout the document that depend on the variable also change. You can do these things using something like R with Markdown, and even more things like including graphs and using the full power of R, but for some things Calca is the way to go. (I’ve also found it helpful in conjunction with Stata, which doesn’t have the Markdown/reproducible tools that R has.)
It’s a great utility tool, and its inexpensive. The Mac App store makes it particularly easy, since it will be auto-updated as well. Highly recommended.