Miskatonic University Press

Installing R from source

23 June 2015 r

UPDATED on 03 May 2016: See Installing R from source (updated).

I use R a lot, but the Ubuntu package repository wasn’t keeping up with current releases, so I decided (even though there was no particular need for me to do this) to install and run R from source. Here’s how I did it.

First, I removed all traces of R from the APT package system. In synaptic I marked r-base, r-base-dev, r-base-core, r-base-html and r-cran-lattice-extra for complete removal (I could have done this with sudo apt-get purge, I guess), and when they went they took a lot of other packages with them. I have a ~/R/86_64-pc-linux-gnu-library/3.1/ directory where libraries have been installed, but I let that be so I could see what packages I’d need to install.

My favourite CRAN mirror is http://cran.utstat.utoronto.ca/ so I got the source from there, then uncompressed it and compiled, then set up some symlinks. I first did that for 3.2.0, but 3.2.1 just came out so this shows how I upgraded, which is repeatable for future releases:

$ mkdir /usr/local/src/R
$ cd /usr/local/src/R
$ curl -O http://cran.utstat.utoronto.ca/src/base/R-3/R-3.2.1.tar.gz
$ tar xzvf R-3.2.1.tar.gz
$ cd R-3.2.1
$ ./configure
$ make
$ make check
$ cd ..
$ rm -f R Rscript
$ ln -s R-3.2.1/bin/R R
$ ln -s R-3.2.1/bin/Rscript Rscript
$ ls -l
lrwxrwxrwx  1 wtd wtd       13 Jun 23 20:57 R -> R-3.2.1/bin/R
drwxr-xr-x 15 wtd wtd     4096 Jun 23 20:52 R-3.2.1
-rw-r--r--  1 wtd wtd 29197870 Jun 22 12:42 R-3.2.1.tar.gz
lrwxrwxrwx  1 wtd wtd       19 Jun 23 20:58 Rscript -> R-3.2.1/bin/Rscript

The aim of the symlinks is to always be able to refer to /usr/local/src/R/R and /usr/local/src/R/Rscript in a stable way, so this addition to my $PATH in .bashrc always works:

PATH=/usr/local/src/R:$PATH

In my .Rprofile I have this line:

options(prompt="ℝ> ")

and that’s why my prompt looks like this when I install the packages I always use (after the welcome message):

$ /usr/local/src/R/R
R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
ℝ> install.packages(c("dplyr", "readr", "ggplot2", "devtools", "lubridate", "shiny", "knitr", "ggvis"))
ℝ> devtools::install_github("rstudio/shinyapps")

And now I’m ready to go.


Barsetshite

23 June 2015 reviews

Novelist Angela Thirkell isn’t well known now. She’s one of a number of mostly forgotten female British writers of the middle of the last century, like Elizabeth Goudge, D.E. Stevenson and Winifred Watson. (For more about women like this check Persephone Books, which is doing a wonderful job of bringing these generations of books back into print.)

I discovered Thirkell a few years ago and read and enjoyed two or three of her books. A friend of mine went on a Thirkell binge over one summer and by the end of it was sick of her, but I had vague fond memories of 1930s or 1940s small-town England, with warm families and eccentric villagers and worries about the church fête. Inconsequential, but fun.

Hoping for something like this, I just read The Headmistress, published in 1944. I disliked it so much I decided I will never read Thirkell again.

The Headmistress

Thirkell sets her novels in Barsetshire, the fictional county used by Anthony Trollope in the six Barsetshire Chronicles. Over the last three or four years (since last reading anything by Thirkell) I’ve read those and the Palliser novels (which as a series I prefer) and a number of other Trollope novels, and Trollope has become one of my favourite writers. He’s magnificent: the authorial voice, the insights into human nature, the richness and variety of the characters, the strong women, the analysis of money and class.

Because Thirkell uses Barsetshire as her setting, 60 or 80 years later, and uses some of the same families, it’s natural to compare them. Thirkell comes out as a mean-spirited smug snob. Where Trollope deeply understood people and their motivations—even people who, knowing it wasn’t the best thing to do, took some course of action that would hurt them or their loved ones—Thirkell has shallowness and caricature.

The Headmistress is about the once well-off Belton family, who, lacking money, move out of their country mansion and into a house in the village. The old place is taken over by a girl’s school, run by a smart, sensible woman (the titular character) who is one of the best people in the novel. She’s got smarts and wits and there’s something real about how a woman like her wasn’t able to become an academic and had to make her way teaching. The Beltons are pretty much an insufferable bunch, with a snobby mother (who is at one point repulsed by the hairy hands of a businessman who assumes a level of equality with her) and a whining daughter and two sons (one all right, the other an idiot). Mr and Mrs Belton feel out of place in the village, having come down in the world, but their friends are very kind to them in these trying circumstances.

There’s a female doctor who’s ridiculed. The hairy-handed businessman (who J.B. Priestley would have handled wittily as a rough diamond) is demeaned. He has a homely, rotund, boil-ridden daughter—who gets top marks in math and physics and is going to go into business with her father, but that’s belittled.

The entire book was so appalling, and such an insult to Trollope’s legacy, that I finished it just to see how it would turn out, and then I threw it in the fireplace because I couldn’t think of any better place to put it. It’s very bad Trollope fanfic.

Avoid Angela Thirkell. Read Trollope. And if you want to read an unjustly ignored female writer of that generation, go to Georgette Heyer and her historical novels. Magnificent fun.


Linux on POS

15 June 2015 unix

Tonight at the supermarket the point-of-sale system wasn’t working—it gave two sad bongs when anyone tried to scan a debit or credit card. The cashier rebooted it (with the classic method of yanking out a cable and sticking it back in) and as it started up I was surprised to see it ran Linux.

Photograph of the POS device booting up: 1

Nice penguin there. Next it showed some COM settings like I haven’t seen in yonks. Terrible photos, I know, but I was in a Loblaws. Don’t judge.

Photograph of the POS device booting up: 1

Power cycling it didn’t help, but they rang me in at the next cash.

Wikipedia informs me that VeriFone “is an American multinational corporation headquartered in San Jose, California that provides technology for electronic payment transactions and value-added services at the point-of-sale” and that what I think is this line of point-of-sale systems “run Embedded Linux and use FST FancyPants and the Opera (browser) for their GUI platform.”

Earlier in the day I bought a bottle of pop from a machine and spent a while musing on the fact that I’d just spent $2.25 for a robot arm to deliver me a bottle of flavoured chemical-water. That’s two bucks too much for the chemicals, but robot arms being deployed widely, that’s something. I wonder what OS the arm runs.


Spectacles and standards

14 June 2015 vagaries code

Two or three years ago I bought “vintage” (i.e. “used”) eyeglasses from Gadabout way out east on Queen here in Toronto. I took them to Josephson Opticians and had my new prescription put in and everything worked very well … until the left temple began to get wiggly in the middle and eventually broke in two.

Photo of eyeglasses with broken temple
A problem in the temple.

I tried tape and glue, but nothing held it together, so I took the glasses back into Josephson to see what they could do. They said they couldn’t weld it—the metal was too thin and that never worked for temples—but they could just order in new temples. The glasses were old, so they used standard parts, and those parts were still available.

It turns out that eyeglasses all used to use standard parts—the frames and design would be different, but the temples and nose pads and hinges and such all had common sizes and screws and could be swapped in or replaced. In Canada today the place to get those parts is McCray Optical Supply, which sells cable temples coloured gold and silver in the common 105 mm length.

New eyeglasses all have different parts. Each manufacturer makes their own hinges and nose pads and you can’t move a piece from one pair over to another’s. When you get glasses now, you’re buying into a closed, proprietary system. The user freedom that came from open standards and open hardware is gone.

I’m happy my eyeglasses are part of the older open spectacle world. The new temples fitted and the glasses are back in action.

Photo of eyeglasses with fixed temple
Fixed!

Interest rates and climate change as music

04 June 2015 sonification music climate.change

Two great examples of turning data into sound and music: Interest Rates: The Musical (“70 years of interest rates ups and downs, with one month represented by one beat, and quarter-point changes given by semitones”) and Planetary Bands, Warming World, composed by Douglas Crawford (“The cello matches the temperature of the equatorial zone. The viola tracks the mid latitudes. The two violins separately follow temperatures in the high latitudes and in the arctic”).

Here’s “Interest Rates: The Musical.” If you don’t know what interest rates were like in the seventies, this will make it clear. And you won’t miss 2008.

And “Planetary Bands, Warming World.” Composer Daniel Crawford (an undergraduate at U Minnesota) worked with geography professor Scott St. George. Using an open climate change data set, Crawford turned surface temperate in the northern hemisphere into a composition for string quartet.


Firefox privacy extensions

27 May 2015 privacy

UPDATE (24 June 2015): See Firefox privacy—updated for improvements.

I noticed yesterday that the RequestPolicy Firefox extension wasn’t working because it’s not being developed any more. There’s a replacement in the works but it didn’t look done enough, so I didn’t install it. I did install a couple of other extensions, which I organized in alphabetical order on the right-hand side of the location bar:

Firefox privacy extension icons
ABP, BP, CM, D, HE, L, PB

They are, in order:

Is there anything else I should use?

I’m still being tracked a lot, even though I deny all third-party cookies and most site-specific cookies. With Lightbeam I can block everything from fonts.googleapis.com and optimizely.com and other places that do nothing useful for me.

With good sites, nothing suffers, or when something breaks I don’t care about it. With some sites I need to fire up another browser and allow everything just to achieve some minor goal like buying a ticket. I suffer that now, but maybe I’ll change my mind.

I’m trying to use Tor more often for browsing sites where I don’t have an account.

Sometimes I look at how other people use the web, and I’m appalled at how awful the experience is, with everything filled with ads (which they can see) and cookies and tracking (which they can’t). On the other hand, there’s how Richard Stallman does things:

I am careful in how I use the Internet.

I generally do not connect to web sites from my own machine, aside from a few sites I have some special relationship with. I usually fetch web pages from other sites by sending mail to a program (see git://git.gnu.org/womb/hacks.git) that fetches them, much like wget, and then mails them back to me. Then I look at them using a web browser, unless it is easy to see the text in the HTML page directly. I usually try lynx first, then a graphical browser if the page needs it (using konqueror, which won’t fetch from other sites in such a situation).

I occasionally also browse using IceCat via Tor. I think that is enough to prevent my browsing from being connected with me, since I don’t identify myself to the sites I visit.

I’m somewhere in the wide middle.


Data meeting

27 May 2015 york

At work I wanted to get access to enrolment numbers by course, so we could have a better idea of how effective the library’s presence is in the university’s course management system.

A few weeks ago I met with A, who works in an administrative office that manages data like this.

He said I should talk to B, who runs the systems where the data lives. A would join the meeting.

Later I ran into C, B’s boss’s boss, who said he’d be there too, because B’s boss was too busy.

Today I met with A, B and C. After some discussion they decided they couldn’t give me the data, but I should talk to D in the registrar’s office.

While we were talking, C messaged D, who said that A should give me the numbers.

A, somewhat surprised by this, said he’d talk to his boss.

All that sounds pretty ridiculous, and it is, but not only am I going to get the data, during the course of the meeting when I explained why I wanted the data B and C said there was some other data that would solve another problem I had, B showed me a network profiling tool they’re using to find bottlenecks that would be useful for my colleagues V and W, A said he’d pull me into some other meetings about different kinds of data, B told me about a Moodle usage database I’ll get access to so I can pull out data I had no idea was being tracked, and I told all of them about some library data we can share with them.

Academia can work very slowly, but in the large private companies I worked at, A wouldn’t have even met with me in the first place, and in a meeting like this, B and C would have been defending their turf, not opening up other data to me I didn’t even know existed. Don’t give me the story about private enterprise always being more efficient.


Mathematics and sculpture

26 May 2015 art

I’m reading The Best Writing on Mathematics 2011, edited by Mircea Pitici, catching up on an older instalment of an excellent series. Once I discovered it I made it an annual purchase. Every year there’s a wonderful range of excellent writing about many different aspects of mathematics.

The 2011 book has a chapter by Helaman Ferguson and Claire Ferguson, a married couple. The chapter doesn’t explain how they work together, but Helaman Ferguson is a mathematician and sculptor. One of his major math achievements is the PSLQ algorithm. His gallery shows his sculptures, including Umbilic Torus NC (1987), which he talks about in the chapter, and related pieces.

I’ve never read anything by someone working at such levels of mathematics and art before. Some quotes:

Stone is one of my favorite media. Maybe I choose stone because I was raised by a stone mason who saw beauty in common field stones. My aesthetic choices include geological age, provenance, and subtraction. We learn addition and then we learn subtraction. Subtraction is harder, isn’t it?

Mathematicians are notorious for wanting to do things themselves, prove their own theorems, or prove other people’s theorems without looking at the known proofs. Sculptors tend to the opposite. Most stone-carving today is like a glamorous rock-music recording production; artists with enough money job it out—outsource. The question for me is “job out what?” How do I job out C functions? Negative Gaussian curvature? More important, having done so, what have I learned?

If someone digs up my theorems in stone in a few thousand years, I expect that the excavator can decode what I have encoded and continue celebrating mathematics.

My Fibonacci Fountain contains over 45 tons of billion-year-old Texas granite. It stands 18 feet above the water, supported underwater by concrete and steel to a depth of 14 feet, which is supported in turn by 28 pilings in 40 feet of mud. When the test cores were drilled no bedrock was found.

To do architectural-size sculpture, I find friends with huge cranes.

I used a seventy-ton crane to lift my block off the truck and ease it down into my studio, where I could finally sink my diamonds into it.

Carving uses many tools, my diamond chainsaw principal among them.

My current sculpture studio is in an industrial park in Baltimore, Maryland. My studio volume is 45,500 cubic feet. My “tool box” is a shipping container, which when filled with hand tools weight 14,000 pounds. As I sit here, I feel in my mind my thirteen-ton block of beautiful billion-year-old Texas red granite, and my fingers sweat. This raw granite block compels me to think of the right timeless theorems. The time is now.