Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. set.seed(1)
  2. time <- rep(seq(1,5), , each = 15)
  3. id <- sample(342:346,75,replace = TRUE)
  4. price <- sample(99:103,75,replace = TRUE)
  5. Desire.Price <- sample(97:105,75,replace = TRUE)
  6. quantity <- sample(1:4,75,replace = TRUE)
  7. data <- data.frame(time = time, id = id,price = price, Desire.Price = Desire.Price,quantity = quantity)
  8. data$buysell <- 0
  9. data$buysell <- ifelse( data$Desire.Price <= data$price, "BUY","SELL")
  10.  
  11. Final.df <- data.frame(time=NA,id=NA,"97" = NA,"98"=NA ,"99"=NA,"100"=NA,"101"=NA,"102"=NA,"103"=NA
  12. ,"104"=NA,"105"=NA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement