Really old R
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 was a little harder than version 2. One thing I learned is that R only accepted underscores in variable names in 1.9.0… before that, the underscore could be used like <-
to assign variables. My script defined a function get_args
to list a function’s arguments, and this was silently redefining base R’s get
… as you can imagine, this was not easy to debug. Cue lots of variable renames.
I’m back to R 1.0.1. It’s interesting to see what has changed and what hasn’t. The ::
operator only arrived in 1.6.0 (more changes to the script), with full namespace support in 1.7.0. Before 1.2.0, I could find no way to write a readable CSV file in the presence of quotes and commas… I ended up backporting write.table
myself.
Oh, and the help search operator didn’t exist:
On the other hand, plenty of stuff is familiar. Basic expressions look very stable:
rcheology %>% filter(Rversion %in% c('1.0.1', '3.5.1'), name=='mean')## package name Rversion type class generic args
## 1 base mean 1.0.1 closure <NA> FALSE (x, ...)
## 2 base mean 3.5.1 closure function FALSE (x, ...)
Even the complex lm
function, which runs linear regression, has gained only a default NULL
for its offset
argument:
rcheology %>% filter(Rversion %in% c('1.0.1', '3.5.1'), name=='lm') %>% select(args)
## args
## 1 (formula, data = list(), subset, weights, na.action, method
## = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE, ## singular.ok = TRUE, contrasts = NULL, offset = NULL, ...)
## 2 (formula, data, subset, weights, na.action, method = "qr", ## model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = ## TRUE, contrasts = NULL, offset, ...)
Incidentally, rcheology is now on CRAN, though the version there only goes back to R 2.x.