Hello,
I need help getting from data$HAVE to data$NEED (see below). This requires
replacing every TRUE in data$HAVE with 4 TRUE(s) in data$NEED. 

Any ideas? It seems straight forward but I can't figure it out!
Thanks in advance


  HAVE             NEED

1  FALSE          FALSE
2  FALSE          FALSE
3  TRUE           TRUE
4  FALSE          TRUE
5  FALSE          TRUE
6  FALSE          TRUE
7  FALSE          FALSE
8  FALSE          FALSE
9  FALSE          FALSE
10 TRUE          TRUE
11 FALSE         TRUE
12 FALSE         TRUE 
13 FALSE         TRUE
-- 
View this message in context: 
http://r.789695.n4.nabble.com/conditional-replacement-of-contiguous-values-tp2968727p2968727.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to