Who we are and how we got here

If you are, at all, interestd in human pre-history, then you should read this book. David Reich, Who we are and how we got here.

(Full disclosure, David is a friend of mine and I did a sabbatical in his lab a few years ago, but I am not just recommending it because of that — or because I’m mentioned in it, which I am :) — no, it really is amazingly good).

If you are worried about catching racism from reading it, don’t be. The only racism you can read into what David writes is stuff you bring yourself. He is very careful about distinguishing between classical racism and what we in genetics could call ancestry. He has a whole chapter on it. And he writes, and I agree completely:

“The right way to deal with the inevitable discovery of substantial differences across populations is to realize that their existence should not affect the way we conduct ourselves. As a society we should commit to according everyone equal rights despite the differences that exist among individuals”

No, no racism in this text — and if you know David you would know that. What is in there is a very exciting description of what ancient DNA has told us over the last decade about human prehistory. So you should read it. Really. Now.

(If you are still in doubt, check some highlights I made while reading it here).

Lots of Function Transformations

The last couple of days I’ve been doing a lot of experimenting with a package for function rewriting: foolbox. I am doing some function transformations in both pmatch and tailr and they look very much alike, so I figured I should collect the shared functionality in a separate package. After that, I found a work-around for the need for function rewriting in pmatch, so it isn’t that necessary any longer, but playing around with foolbox has been fun and taught me a lot of tricks for metaprogramming that I hadn’t thought about before.

I have written documentation on foolbox’s homepage so I won’t repeat it here but refer you to

I am pretty sure that you can implement the function transformations with invariants and pre- and post-conditions. I also think that some static type checking should be possible (for a subset of functions, of course, R is way too dynamic a language to try to handle all cases).

I was thinking of making a release later this week or sometime next week and then return to working on pmatch and tailr. I might play around it a bit more first, though. In any case, I would love if anyone else would take it for a spin and help me debug it.

Writing tools

As you know, I have explored several different writing tools and setups for books and blogs.

My current setup is iA Writer for writing — it used to be Ulysses or Sublime. Ulysses changed to a subscription form and in any case was hard to combine with my other pipeline, so those two issues combined moved me away from Ulysses. Sublime is a great editor for both coding and writing, but for some reason the keybindings on my laptop are different from the bindings on my desktop — and I haven’t figured out how to change that — and that annoyed me sufficiently to not use that editor for writing. So iA Writer it is.

For posting on this blog, I can send text and images directly from iA Writer to WordPress. For my books, I write Markdown files that I process with Pandoc and, for R books, knitr. I have a setup with Makefiles to handle that, and that works well. For my new R blog, I haven’t figured out the right workflow yet. I’m writing in RMarkdown, so some combination of iA Writer and knitr combined with Hugo is likely to be the solution. If I can get Blogdown to work, that would be great, but Makefiles usually work well for me if I don’t manage that.

Anyway, I am always interested in learning about new tools and new pipelines, and now Ferry Vermeulen from INSTRKTIV has sent me this list of resources. I haven’t explored it fully yet, but when I have a quiet moment I will see if there are tools there I absolutely have to try out.

What are your preferred writing tools? For blogging, papers or books?

New R blog

For a while, I’ve been frustrated by the pains involved with showing R code on this blog. Compared to the simple Markdown syntax and the Markdown Pandoc pipeline I’ve used for my R books, displaying code here is really a drag.

Therefore, I have set up a blog dedicated to R programming on GitHub. That is where I will write about R—but if you want to get updated on the posts here, you can stay. I will link to new posts from here.

If you are only interested in R programming, and only listen to the other noise here to get to those good bits, you can just move over to the other blog and subscribe there.