SHARE
TWEET

Untitled

a guest Jun 20th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '%!in%' <- function(x,y)!('%in%'(x,y))
  2.  
  3.  
  4.  
  5. for(i in 1:nrow(dt_loop)){
  6.   m <- dt_loop$m[i]
  7.   c <- dt_loop$m[i]
  8.  
  9.   if(m %!in% dt_loop$ma[1:i] & c %!in% dt_loop$ma[1:i]){
  10.     dt_loop$ma[i] <- m
  11.   } else {
  12.     if(m %in% dt_loop$ma[1:i]){
  13.       dt_loop$ma[i] <- m
  14.     } else {
  15.       dt_loop$ma[i] <- c
  16.     }
  17.   }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top