Displaying 1 result from an estimated 1 matches for "chars_dup".
2012 Feb 11
2
Derive pattern from vector
...g numbers.
However, for the char 'F' it should be always increasing numbers. Is that
possible in R?
I used the following code:
chars <- c('A', 'B', 'C', 'C', 'D', 'E', 'E', 'E', 'F', 'F', 'F')
chars_dup <- duplicated(chars)
cumsum(!chars_dup)
[1] 1 2 3 3 4 5 5 5 6 6 6
But I do not know how to treat 'F' in the way described above.
Regards
--
View this message in context: http://r.789695.n4.nabble.com/Derive-pattern-from-vector-tp4379312p4379312.html
Sent from the R help maili...