Re: [R] Recoding scores of negatively worded item

From: Gabor Grothendieck <ggrothendieck_at_myway.com>
Date: Sun 04 Jul 2004 - 03:17:38 EST

Jonathan Baron <baron <at> psych.upenn.edu> writes:

: ces$score <- ifelse(ces$question %in% c(1,3,5),5-ces$score,ces$score)

One minor improvement in readability might be:

ces$score <- with(ces, ifelse(question %in% c(1,3,5), 5-score, score))



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 04 03:20:57 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:40 EST