Skip to content
Prev 98894 / 398498 Next

Create a vector from another vector

maybe something like this could be of help:

max.score <- c(3,4,3) # max score for each item
all.pats <- as.matrix(expand.grid(lapply(max.score, ":", 1)))
all.pats[rowSums(all.pats) == 5, ]



Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Doran, Harold" <HDoran at air.org>
To: "Duncan Murdoch" <murdoch at stats.uwo.ca>
Cc: <r-help at stat.math.ethz.ch>
Sent: Wednesday, August 30, 2006 4:49 PM
Subject: Re: [R] Create a vector from another vector
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm