My first R program

Standard

Having used Groovy (which makes the scripting environment feel familiar) and some Scheme (via Structure and Interpretation of Computer Programs), R does feel completely alien, but it still feels like a steep learning curve.

But here’s my short script –

unpatched <- read.csv("~/unpatched.txt")
unpatchcons <- transform(unpatched, realm=realm*60 + reals)
attach(unpatchcons)
linelog<-lm(realm~size)
plot(size, realm, log="y")
abline(reg=linelog, untf=TRUE, col="blue",lty=3)
detach(unpatchcons)

And here’s the graph (of Linux kernel compile times) it generates – the blue line is obviously a very bad fit!

Linux kernel compile times

2 thoughts on “My first R program

  1. A log-linear model (log of realm, which from context I suspect is seconds rather than minutes and so perhaps should be “reals”, versus size) would come closer, but I suspect would still not be right (residuals would likely exhibit a pattern).

    • Yes, “realm” is seconds: guess I should just fiddle with that transform to fix that. And, yes, does look like a log linear one to me too – though with the issues you suggest. I might have to cite you in my MSc project if you keep this up🙂

Comments are closed.