[plt-scheme] Scheme and R

From: Noel Welsh (noelwelsh at gmail.com)
Date: Thu Mar 26 13:30:34 EDT 2009

On Thu, Mar 26, 2009 at 5:24 PM, Neil Toronto <ntoronto at cs.byu.edu> wrote:
>> I'm wondering if anyone on this list has experience with teaching R or
>> with making explicit the connections between R and Scheme. I'd like to take
>> more notice of this in our first-year CS classes, and help prepare students
>> for the use of R in their second-year stats class. --PR

> As a language it's rather weak and inconsistent.

I agree with this, and the rest of Neil's analysis.  It would be
simple to create a PLT Scheme language that extends the numeric
operators to vectors in addition to scalars. Perhaps one should also
replace the list operations with the vector equivalents. This could be
used to introduce R-esque programming.

For my own work I have written most of the vector operations you'd
need (vector-+/-*, vector-sum, vector-append, vector-map etc.) Note
that I haven't done much of anything for matrices or arrays of higher
dimension.

You can do some fun stuff with Monte Carlo simulations, for a variety
of definitions of fun. Examples:
- computing the value of PI
- finding the stationary distribution of a Markov chain (your very own Google!)
- photorealistic rendering

N.


Posted on the users mailing list.