Hello All, 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 Thank you Zam _________________________________________________________________________________ This email contains confidential information intended only for the person named above and may be subject to legal privilege. If you are not the intended recipient, any disclosure, copying or use of this information is prohibited. The Department provides no guarantee that this communication is free of virus or that it has not been intercepted or interfered with. If you have received this email in error or have any other concerns regarding its transmission, please notify Postmaster at dhs.vic.gov.au
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/
I think Michael K has covered the comb issue. Have a look at ?read.table (you want read.csv for ease of use) ?save --- Zamikhaya.Mbalu at dhs.vic.gov.au wrote:> > > Hello All, > > 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 > > Thank you > > Zam > > > >_________________________________________________________________________________> > This email contains confidential information > intended only for the person named above and may be > subject to legal privilege. If you are not the > intended recipient, any disclosure, copying or use > of this information is prohibited. The Department > provides no guarantee that this communication is > free of virus or that it has not been intercepted or > interfered with. If you have received this email in > error or have any other concerns regarding its > transmission, please notify > Postmaster at dhs.vic.gov.au > > ______________________________________________ > 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. >