Re: [R] Multiple-Response Analysis: Cleaning of Duplicate Codes

2017-04-25 Thread Boris Steipe
How about: d_sample_1 <- floor(d_sample/100) * 100 for (i in 1:nrow(d_sample_1)) { d_sample_1[i, duplicated(unlist(d_sample_1[i, ]))] <- NA } B. > On Apr 25, 2017, at 1:10 PM, Bert Gunter wrote: > > If I understand you correctly, one way is: > >> z <- rep(LETTERS[1:3],4) >> z > [1] "A

Re: [R] Multiple-Response Analysis: Cleaning of Duplicate Codes

2017-04-25 Thread Bert Gunter
If I understand you correctly, one way is: > z <- rep(LETTERS[1:3],4) > z [1] "A" "B" "C" "A" "B" "C" "A" "B" "C" "A" "B" "C" > z[!duplicated(z)] [1] "A" "B" "C" ?duplicated -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it

[R] Multiple-Response Analysis: Cleaning of Duplicate Codes

2017-04-25 Thread G . Maubach
Hi All, in my current project I am working with multiple-response questions (MRSets): -- Coding -- 100 Main Code 1 110 Sub Code 1.1 120 Sub Code 1.2 130 Sub Code 1.3 200 Main Code 2 210 Sub Code 2.1 220 Sub Code 2.2 230 Sub Code 2.3 300 Main Code 3 310 Sub Code 3.1 320 Sub Code 3.2 The coding