Re: [Rd] Which programming paradigm is the most used for make R packages?

From: Barry Rowlingson <>
Date: Thu 04 Jan 2007 - 10:52:05 GMT

Ross Boylan wrote:
> On Wed, Jan 03, 2007 at 11:46:16AM -0600, Ricardo Rios wrote:
>> Hi wizards, does somebody know Which programming paradigm is the most
>> used for make R packages ? Thanks in advance.
> You need to explain what you mean by the question, for example what
> paradigms you have in mind.

  Judging by the R code some people in our department write, the most used paradigm is 'bash something out that works and worry about paradigms later'-paradigm, used in conjunction with the 'write a very long .R file and source() it whenever you want to do something'-paradigm. This seems related to the 'write-first' paradigm, as opposed to the 'think-first' paradigm.

  Partly this is often due to the exploratory nature of working with R. You get a data set. You go 'okay, well, what's the mean of each column?', and do that. Then you wonder how A depends on B. Then you wonder how A depends on B given, ooh, C. Then you think, well, if I split the data into old and new measurements, rescaled by the median and offset by D, maybe something interesting appears. By now you've written 40 lines of R code and its starting to get messy...

  By the end of the thesis, instead of a nice neat redistributable R package that would look great on CRAN, there's a whole pile of R code scattered around in various directories.

  How many statistics departments still teach programming to their undergraduates? We dropped Fortran about 10 years ago, nowadays they maybe type a few things into a script for Matlab in their second year, learn R at the end of year 2, and do a project perhaps with R in their third year. But they are expected to develop their own paradigm for working in R. I don't think the fundamentals of programming, let along the idea of paradigms (functional/OO/whatever) is introduced.

  Scary. And wandering off-topic.

Barry mailing list Received on Thu Jan 04 21:50:36 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 04 Jan 2007 - 14:31:08 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.