[R] Newbie: Combn and scripting

Michael Kubovy kubovy at virginia.edu
Tue Mar 27 11:24:06 CEST 2007


x <- matrix(c('a', 'b', 'c', 'd', 1:4, 'g', 3, 6, 't'), nrow = 3,  
byrow = T)
comb <- vector('list', 3)
for(i in 1:3) comb[[i]] <- combn(x[i,], 3)

On Mar 27, 2007, at 1:55 AM, Zamikhaya.Mbalu at dhs.vic.gov.au wrote:

> I have just installed my R 2.4 (windows) as a test trying to load a  
> data
> frame and run combn() for each line into another file. How do I do  
> this?
>
> data.csv:
> a,b,c,d
> 1,2,3.4
> g,3,6,t
> etc
>
> x=data.csv, m=3



_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



More information about the R-help mailing list