Pythagorean Triples with Comprehensions

I’ve been learning at least one new programming language per month through Exercism and the #12in23 challenge. I’ve keep saying, every time you learn a new language, you learn something about all the others you know. Plus, once you know \(N\) languages, the \(N+1^{\rm th}\) is significantly easier. This post covers a calculation I came across in Haskell, and how I can now do the same in a lot of other languages - and perhaps can’t as easily in others.

[Read More]

Wrapping C Code in an R Package

Your collaborator says to you “I have some code I’d like to distribute to people who will probably work in R most of the time. I don’t write R, but I write C. Can you package this up for me?” so you have a few options: re-write the code in R, package up the C code and make it available in R, or say no. I decided to try out the second of these, and this post details how I achieved that.

[Read More]
rstats  c