[Haskell-cafe] data analysis question

Roman Cheplyaka roma at ro-che.info
Thu Nov 13 02:22:34 UTC 2014


On 12/11/14 09:21, Peter Simons wrote:
> Hi Roman,
> 
>  > With Haskell you don't have to load the whole data set into memory,
>  > as Michael shows. With R, on the other hand, you do.
> 
> Can you please point me to a reference to back that claim up?
> 
> I'll offer [1] and [2] as a pretty good indications that you may not be
> entirely right about this.

Ah, great then.

My impression was formed after listening to this FLOSS weekly episode:
http://twit.tv/show/floss-weekly/306 (starting from 33:55).

>  > Besides, if you're not an R expert, and if the analysis you want to do
>  > is not readily available, it may be quite a pain to implement in R.
> 
> Actually, implementing sophisticated queries in R is quite easy because
> the language was specifically designed for that kind of thing. If you
> have no experience in neither R nor Haskell, then learning R is *far*
> easier than learning Haskell is because it doesn't aim to be a powerful
> general-purpose programming language. It aims to be a powerful language
> for data analysis.

That doesn't match my experience. Maybe it's just me and my
unwillingness and write C-like code that traverses arrays by indexes (I
know most scientists don't have a problem with that), but I found it
hard to express data transformations and queries functionally in R.

>  > I still don't know an acceptable way to write something like zipWith
>  > f (tail vec) vec in R.
> 
> Why would that be any trouble? What kind of solutions did you find and
> in what way were they unacceptable?

This was a while ago, and I don't remember what solution I picked up
eventually. Of course I could just write a for-loop to populate an
array, but I hadn't found anything that matches the simplicity and
clarity of the line above. How would you write it in R?

Roman


More information about the Haskell-Cafe mailing list