Try this. It uses the fact that 2 column matrices can be used
as subscripts (as described in the Matrices and arrays section
of ?Extract):
with(recodes, replace(as.matrix(main), cbind(id, qst + 1), value))
It returns a matrix so use as.data.frame on that to turn it
back to a data frame, if need b
Dear list,
I'd like to update certain rows/columns in a data
frame with new values. The application is that
survey respondents may give an answer of "Other"
to a categorical question and then provide some
text describing what they mean. This text is then
reviewed and placed into a category. These
2 matches
Mail list logo