Guest User

Untitled

a guest
Jul 16th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. mav <- function(x, n = 5) { filter(x, rep(1 / n, n), sides = 1) }
  2.  
  3. Close <- c(21000, 23400, 26800, 21000, 23400, 26800)
  4. SourceData <- data.frame(Close)
  5. SourceData$CloseMA1 <- mav(SourceData$Close, n = 2)
  6.  
  7. Error in UseMethod("filter_") :
  8. no applicable method for 'filter_' applied to an object of class "c('double', 'numeric')"
Add Comment
Please, Sign In to add comment