Skip to content
Prev 172120 / 398506 Next

Combining 2 arrays into a third array via a function

Better to not use c as a variable name. It's such a useful function  
name.

This is what I would have tried:

col3 <- expand.grid(item=params.data$item, examinee=examinees.data 
$examinee)
col3$p_val <- p( c( params.data[ col3["item"],     c("a1", "a2", "b1",  
"b2", "c") ],
                 examinees.data[ col3["examinee"], c("theta1",  
"theta2")]
                   )
               )

If you had provided executable test data I would have tested it, but I  
am getting rather bored with creating such for posters who won't  
follow the posting guide. If you had just used dput() around those  
calls to head() it would have been trivial. As it is, I am not sure if  
this will properly run. Could need a different "driving" construction  
to get the values of col3 to "feed through" to the row indices. Or  
have any number of stoopid errors.