Gentoo Archives: gentoo-soc

From: Auke Booij <auke@××××××.com>
To: gentoo-soc@l.g.o
Subject: [gentoo-soc] G-CRAN weekly report #4
Date: Tue, 22 Jun 2010 20:48:43
Message-Id: AANLkTily_bwxEL5ZpylUR7YLAB-GHFcWsvLWmCcQI-4B@mail.gmail.com
1 Wow, did I just type "G-CRAN weekly report #4"? Time's flying when
2 you're having fun, *cough*.
3
4 Alright, so R is a big mess. Sure, you can just issue an R CMD INSTALL
5 to install new packages. R CMD INSTALL gets processed by the R
6 executable, which is a bash script. It detects the second argument is
7 CMD, so it passes control to the INSTALL bash script. But let's say
8 you want to do it the clean way and install new packages directly from
9 within R.
10
11 So you're in the R shell, and issue install.packages(). Hm, the output
12 looks familiar. The code? Hey, what's this? install.packages actually
13 does a lot of hard work to simply call R CMD INSTALL. That's right, it
14 does the R equivalent of system(). So the magic must be in the INSTALL
15 script, right? Haha, no. The INSTALL bash script seriously issues...
16 an R script. The function is called tools:::.install_packages, and
17 it's a piece of code you can hardly scroll through. Thank god I don't
18 have to maintain this beast.
19
20 The conclusion? I'm not going to worry about cleanliness and am just
21 calling system()s on the R executables, to avoid getting into internal
22 libraries. To cleanly split the src_compile and src_install phase, I'm
23 first going to build a binary R package from source during
24 src_compile, and then extract that into the image directory in
25 src_install.
26
27 It took me some time to discover all this, resulting in very little
28 code being written. Oh, and I have some exams these weeks. This really
29 was that one week for me, and as bicatali already told me, it's time I
30 shift into second gear, and this will be my goal for next week,
31 together with building packages.