public inbox for gentoo-soc@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-soc] G-CRAN weekly report #4
@ 2010-06-22 20:48 Auke Booij
  0 siblings, 0 replies; only message in thread
From: Auke Booij @ 2010-06-22 20:48 UTC (permalink / raw
  To: gentoo-soc

Wow, did I just type "G-CRAN weekly report #4"? Time's flying when
you're having fun, *cough*.

Alright, so R is a big mess. Sure, you can just issue an R CMD INSTALL
to install new packages. R CMD INSTALL gets processed by the R
executable, which is a bash script. It detects the second argument is
CMD, so it passes control to the INSTALL bash script. But let's say
you want to do it the clean way and install new packages directly from
within R.

So you're in the R shell, and issue install.packages(). Hm, the output
looks familiar. The code? Hey, what's this? install.packages actually
does a lot of hard work to simply call R CMD INSTALL. That's right, it
does the R equivalent of system(). So the magic must be in the INSTALL
script, right? Haha, no. The INSTALL bash script seriously issues...
an R script. The function is called tools:::.install_packages, and
it's a piece of code you can hardly scroll through. Thank god I don't
have to maintain this beast.

The conclusion? I'm not going to worry about cleanliness and am just
calling system()s on the R executables, to avoid getting into internal
libraries. To cleanly split the src_compile and src_install phase, I'm
first going to build a binary R package from source during
src_compile, and then extract that into the image directory in
src_install.

It took me some time to discover all this, resulting in very little
code being written. Oh, and I have some exams these weeks. This really
was that one week for me, and as bicatali already told me, it's time I
shift into second gear, and this will be my goal for next week,
together with building packages.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-22 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 20:48 [gentoo-soc] G-CRAN weekly report #4 Auke Booij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox