Installing R 2.14.0 on an iBook G4 running Mac OS 10.4.11

My 12" iBook G4 is celebrating its 8th birthday today! Time for a little present. How about R 2.14.0?

The iBook is still in daily use, mostly for browsing the web, writing e-mails and this blog; and I still use it for R as well. For a long time it run R 2.10.1, the last PowerPC binary version available on CRAN for Mac OS 10.4.11 (Tiger).

But, R 2.10.1 is a bit dated by now and for the development of my googleVis package I require at least R 2.11.0. So I decided to try installing the most recent version from source, using Xcode 2.5 and TeXLive-2008.

R 2.14.0 is expected to be released on Monday (31st October 2011). The pre-release version is already available on CRAN. I assume that the pre-release version is pretty close to the final version of R 2.14.0, so why wait?

It was actually surprisingly easy to compile the command line version of R from sources. The GUI would be a nice to have, but I am perfectly happy to run R via the Terminal, xterm and Emacs. However, it shouldn't be a surprise that running configure, make, make install on a 800 Mhz G4 with 640MB memory does take its time.
Below you will find the building details. Please feel free to get in touch with me, if you would like access to my Apple Disk Image (dmg) file. You find my e-mail address in the maintainer field of the googleVis package.

Building R from source on Mac OS 10.4 with Xcode 2.5 (gcc-4.0.1)


Before you start, make sure you have all the Apple Developer Tools installed. I have Xcode installed in /Developer/Applications.

From the pre-release directory on CRAN I downloaded the file R-rc_2011-10-28_r57465.tar.gz.

After I downloaded the file I extracted the archive and run the configure scripts to build the various Makefiles. To do this, I opened the Terminal programme (it's in the Utilities folder of Applications), changed into the directory in which I stored the tar.gz-file and typed:
tar xvfz R-rc_2011-10-28_r57465.tar.gz
cd R-rc
./configure
This process took a little while (about 15 minutes) and at the end I received the following statement:
R is now configured for powerpc-apple-darwin8.11.0

Source directory: .
Installation directory: /Library/Frameworks

C compiler: gcc -std=gnu99 -g -O2
Fortran 77 compiler: gfortran -g -O2

C++ compiler: g++ -g -O2
Fortran 90/95 compiler: gfortran -g -O2
Obj-C compiler: gcc -g -O2 -fobjc-exceptions

Interfaces supported: X11, aqua, tcltk
External libraries: readline, ICU
Additional capabilities: NLS
Options enabled: framework, shared BLAS, R profiling, Java

Recommended packages: yes
With all the relevant Makefiles in place I could start the build process via:
make -j8
Now I had time for a cup of tea, as the build took about one hour. Finally, to finish the installation, I placed the new R version into its place in /Library/Frameworks/ by typing:
sudo make install
Job done. Let's test it:
Grappa:~ Markus$ R

R version 2.14.0 RC (2011-10-28 r57465)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: powerpc-apple-darwin8.11.0 (32-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.

> for(i in 1:8) print("Happy birthday iBook!")
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"
[1] "Happy birthday iBook!"


The installation of additional packages worked straightforward via install.packages(c("vector of packages")), though it took time, as everything was build from sources. This it what it looks like on my iBook G4 today:
> installed.packages()[,"Version"]
ChainLadder GillespieSSA Hmisc ISOcodes KernSmooth MASS
"0.1.5-0" "0.5-4" "3.8-3" "2011.07.31" "2.23-6" "7.3-16"
Matrix R.methodsS3 R.oo R.rsp R.utils RColorBrewer
"1.0-1" "1.2.1" "1.8.2" "0.6.2" "1.8.5" "1.0-5"
RCurl RJSONIO RUnit Rook XML actuar
"1.6-10" "0.96-0" "0.4.26" "1.0-2" "3.4-3" "1.1-2"
base bitops boot brew car class
"2.14.0" "1.0-4.1" "1.3-3" "1.0-6" "2.0-11" "7.3-3"
cluster coda codetools coin colorspace compiler
"1.14.1" "0.14-4" "0.2-8" "1.0-20" "1.1-0" "2.14.0"
data.table datasets digest flexclust foreign gam
"1.7.1" "2.14.0" "0.5.1" "1.3-2" "0.8-46" "1.04.1"
ggplot2 googleVis grDevices graphics grid iterators
"0.8.9" "0.2.10" "2.14.0" "2.14.0" "2.14.0" "1.0.5"
itertools lattice lmtest mclust methods mgcv
"0.1-1" "0.20-0" "0.9-29" "3.4.10" "2.14.0" "1.7-9"
modeltools mvtnorm nlme nnet parallel party
"0.2-18" "0.9-9991" "3.1-102" "7.3-1" "2.14.0" "0.9-99994"
plyr proto pscl reshape rpart sandwich
"1.6" "0.3-9.2" "1.04.1" "0.8.4" "3.1-50" "2.2-8"
spatial splines statmod stats stats4 strucchange
"7.3-3" "2.14.0" "1.4.13" "2.14.0" "2.14.0" "1.4-6"
survival systemfit tcltk tools utils vcd
"2.36-10" "1.1-8" "2.14.0" "2.14.0" "2.14.0" "1.2-12"
zoo
"1.7-5"

Update (3 June 2012)

Just updated my R installation to R-2.15.0 and the above procedure still worked. But I had to be patient. It took at least an hour to compile R and the core packages.
R version 2.15.0 Patched (2012-06-03 r59505) -- "Easter Beagle"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: powerpc-apple-darwin8.11.0 (32-bit)

Update (1 June 2013)

Just updated my R installation to R-3.0.1 and the above procedure still worked. The iBook will be 10 years old soon and is still going strong. Not bad for such an old laptop.
R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin8.11.0 (32-bit)

Using Sweave with XeLaTeX

Using R with LaTeX via Sweave is a great way to create reproducible output. However, using specific fonts, e.g. your corporate fonts, can be painful with pdflatex. Over the last few weeks I have fallen in love with the TeX format XeLaTeX and its XeTeX engine.

With XeLaTeX I had to overcome some hurdles, which I would like to share here:

  • attaching files,
  • trimming and clipping images,
  • learning how to use the tikzDevice package.




The Sweave file of the above document is attached to the PDF-file itself, but you can also find it on github: SweaveXeLaTeXExample.Rnw.

Pulling The Plug

This blog has campaigned for transparency, honesty, and basic accounting principles. This isn’t a Democrat or a Republican issue. This isn’t Left or Right. Asking for our elected officials to perform at a higher level may, at times, appear child-like and naïve, but why would we work so hard, investing our time and money, if we didn’t believe that we were trying to help our country find our best leaders?

Flying to New York this past weekend gave me extra time to read. I need to share an opinion piece from The New York Times and a memo from Health and Human Services. This will take a few minutes. It will be time well spent.

Jane Gross, author of A Bittersweet Season: Caring for Our Aging Parents and Ourselves, discussed the last years of her mother’s life in The New York Times. The article, How Medicare Fails the Elderly, detailed the medical care Medicare paid and the hundreds of thousands of dollars of services that depleted the family’s savings. It was brutal. Ms. Gross lays bare the inefficiencies of a system that rewards unwarranted expensive procedures that may more successfully enhance the medical provider’s life than the patient’s. Please read the article. It is a difficult read and there wasn’t a happy ending.

The memo is also about an ending. Kathy Greenlee, CLASS Administrator, sent a memo to the Secretary of Health and Human Services, Kathleen Sebelius, recommending that the program be suspended. CLASS is the acronym for the Community Living Assistance Services and Support Act. Ms. Greenlee was forced to report that there was no logal way to make this program work.

This was not a shock.

The CLASS Act was an important part of the Patient Protection and Affordable Care Act (PPACA). It was important to consumers because it promised to help pay for long term care. It was even more important to the President because, through a bit of accounting sleight of hand, the CLASS Act generated a $70 billion dollar surplus during the first ten years. That money would cover $70 billion dollars of deficit from the PPACA. See, revenue neutral!

Ms. Greenlee was forced to admit that the numbers did not add up. A voluntary program that didn’t have any underwriting couldn’t be actuarially sound the way the law was written. With no public funding available and healthy people not forced to participate, the independent actuaries predicted disaster. Thankfully, the program will be pulled now before any more money is wasted.

The need for long term care planning and the cost of that care are the themes that tie these two readings together. My fixation on transparency is why I have brought them to your attention.

DAVE

www.bcandb.com

R related books: Traditional vs online publishing

How many R related books have been published so far? Who is the most popular publisher? How many other manuals, tutorials and books have been published online? Let's find out.

A few years ago I used the publication list on r-project.org as an argument with the IT department that R is an established statistical programming language and that they should allow me to install it on my PC. I believe at the time there were about 20 R related books available.

A recent post on Recology pointed me to a talk given by Ed Goodwin at the Houston R user group meeting about regular expressions in R, something I always wanted to learn properly, but never got around to do.

So let's see, if we can manage to extract the information of published R books and texts from r-project.org, with what we learned from Ed about regular expressions in R.
Read more »

Perfectibility

Prohibition was about human perfectibility, that humans can be perfected. You could have the perfect marriage if you could eliminate alcohol. from Ken Burns' Prohibition

I watched Ken Burns’ Prohibition on PBS last night. A group of people decided what would be best for everyone else. Armed with moralistic fervor inspired in equal parts by their G-d and their fear of others (immigrants and non-whites), they campaigned to eliminate someone else’s vice. And they succeeded in part until they failed entirely.

There is a shocking parallel between the Prohibition movement of one hundred years ago and today’s health care debate.

Part of what drives the current discussion is this concept of perfectibility. If only the profit motive was removed from the delivery of health care, if access was unlimited, then no one would die before his/her time.

  • Can you really remove profit from health care?

  • How unlimited is unlimited?

  • When is it our time?


The simple answers are - NO!, Who knows?, and Gosh, what a silly question.

Doctors need to be paid. Medical equipment suppliers need profits to build their businesses. Pharmaceutical companies risk millions to develop new compounds that may cure illnesses and alleviate pain and suffering. The insurers play a role in all of this, too. Eliminate them, the market organizers, and their function will have to be performed by the government. You may debate whether that would be more efficient that the businesses, but to deny that money is a key element in the delivery of health care is to deny reality.

Heart transplants? Liver transplants? Any age? Any health status? Should a 75 year old overweight diabetic with bad lungs from years of smoking stand in the front of the line waiting for a new heart? There have always been, and always will be, some limits to access. What we have not had, as a country, is an open, honest discussion about limits. We are not talking about death panels. We are talking about realistic expectations. What is society’s responsibility to the sick and injured?

The last part of this is the most difficult. Who amongst us wants to address our own mortality? No amount of health care would keep us alive forever. We are not machines. Yet there are people who claim that changing our health care delivery system will magically enhance our life expectancy.

Which returns us to this concept of human perfectibility. Can we improve the payment and delivery of health care in the United States? Absolutely! The first steps will be transparency and an honest discussion about achievable goals.

Now would be a good time to start.