[R] Lisp-like primitives in R

Greg Snow Greg.Snow at intermountainmail.org
Thu Sep 6 22:10:13 CEST 2007


Not all of us are familiar with lisp (I have done a little, but not
enough to really understand what you are asking).  If you tell us what
find, member, cond, and loop do, or what functionality you are looking
for, then we will have a better chance of telling you how to do the same
in R.

Just guessing by the names:

The 'which' function may do something similar to 'find'.

'is.element' or '%in%' may do the same as 'member'.

'ifelse' and/or 'switch' may do what 'cond' does.

'replicate', 'lapply', 'sapply', 'while', and 'for' may give the
functionality of 'loop'.

Those are just guesses based on the names, I don't know what exactly
they do, so if I am way off, then tell us what you want them to do.


-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Chris Elsaesser
> Sent: Thursday, September 06, 2007 11:26 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Lisp-like primitives in R
> 
> I mainly program in Common Lisp and use R for statistical analysis.
> 
> While in R I miss the power and ease of use of Lisp, 
> especially its many primitives such as find, member, cond, 
> and (perhaps a bridge too far) loop.
> 
> Has anyone created a package that includes R analogs to a 
> subset of Lisp functions?
> 
> 
> Chris Elsaesser, PhD        
> Principal Scientist, Machine Learning
> SPADAC Inc.
> 7921 Jones Branch Dr. Suite 600
> McLean, VA 22102  
> 
> 703.371.7301 (m)
> 703.637.9421 (o)
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list