Guest User

Untitled

a guest
Jul 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. # zoo time series called ts
  2. # create weekly trend variables
  3. wkgain = diff(ts, lag=5)
  4. #error due to non-numeric argument to binary operator
  5.  
  6. ts<- zoo(data1,as.Date(dates,"%Y-%m-%d"))
  7. Warning message:
  8. In zoo(data1, as.Date(dates, "%Y-%m-%d")) :
  9. some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
  10.  
  11. ts
  12. Date Open High Low Close Volume Adj.Close
  13. <NA> 31/12/13 3166.26 3169.20 3158.15 3167.43 245359800 3167.43
  14. <NA> 30/12/13 3159.68 3164.86 3150.26 3153.29 107880500 3153.29
  15. <NA> 27/12/13 3144.87 3154.82 3142.37 3149.76 174566000 3149.76
  16.  
  17. data1
  18. Date Open High Low Close Volume Adj.Close
  19. 1 31/12/13 3166.26 3169.20 3158.15 3167.43 245359800 3167.43
  20. 2 30/12/13 3159.68 3164.86 3150.26 3153.29 107880500 3153.29
  21. 3 27/12/13 3144.87 3154.82 3142.37 3149.76 174566000 3149.76
  22. 4 26/12/13 3131.94 3138.15 3130.23 3134.36 61807500 3134.36
Add Comment
Please, Sign In to add comment