Here’s some simple mistakes inexperienced R programmers make.

Thinking that c() creates a vector

When you read R code, you see stuff like c(1, 2, 3) a lot. So, obviously that’s how you make a vector, right? Then you write stuff like

if (c(2) + c(2) == c(4)) ...


Someone asked me on HN why I hated TeX. I thought my response deserved an article of its own.

Bottom line: TeX is a leftover from the 1980s. In the 1980s it was probably quite good. …

DU FU: A beautiful night!

LI BAI: Perfectly clear. Can you see the Plough?

DU: Over there, low on the horizon. And isn’t that Orion? But you didn’t invite me here to do astronomy. What is this… contraption?

He points at something like a high-tech barrel organ.

LI: Keep looking…

I’m an academic. Our university uses Blackboard to manage its courses. Using Blackboard is compulsory. Like everything that humans have to be made to use, it sucks. You have to be made to use it, because it sucks; it sucks, because you’re made to use it.

Here, then, is a…

This took me a long time to figure out.

Points to note:

  1. By default, appveyor.yml scripts don’t understand double quote marks. So start everything with cmd: and it will be fine.
  2. Appveyor has a version of xz that doesn’t play nicely with tlmgr. So set the enviroment variable TEXLIVE_PREFER_OWN to 1, so tlmgr will use its own built-in copy of xz.

Here’s the relevant chunks of appveyor.yml, showing how to get tinytex installed and download a package. This assumes that tinytex is a dependency listed in your DESCRIPTION file.

- install_deps
- cmd: Rscript -e "tinytex::install_tinytex()"
- cmd: Rscript -e "tinytex::tlmgr_install('latexdiff')"
- cmd: Rscript -e "tinytex::tlmgr_path('add')"

I’m a tidyverse fan. I am not hugely interested in “tidyverse vs. base R” conflicts. I’ve been using R for quite a while; many tidyverse packages (and RStudio) have made it a lot nicer to work in.

I do feel there is one fair point made on the anti-tidyverse side…

If you use rmarkdown to produce pdfs, you may find you have problems with the latest RStudio when printing out LaTeX tables using R packages like xtable or huxtable. Recent versions of pandoc often escape TeX, resulting in errors when you try to compile your PDF.

You can check if…

On Friday I decided to extend the rcheology package, which lists functions and objects in old versions of R, back to 1.x versions.

rcheology works by compiling the old versions of R from source, then loading them and running a simple R script to list variables in all packages. This…

David Hugh-Jones

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store