Hello,
Here is a slightly more sophisticate and fully vectorized, answer.
RecodeChoices - function(mat) {
# Make sure mat is a matrix (in case it is a data.frame)
mat - as.matrix(mat)
# Get dimensions of the matrix
Dim - dim(mat)
Nr - Dim[1]
Nc -
On 06/07/04 21:28, Greg Blevins wrote:
Hello R folks.
1) The question that generated the data, which I call Qx:
Which of the following 5 items have you performed in the past month? (multipe
response)
2) How the data is coded in my current dataframe:
The first item that a person selected is
On 06/07/04 22:45, Jonathan Baron should have written:
for (i in [whatever]) Y[i,][X[i,]] - 1
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!