Skip to content

Instantly share code, notes, and snippets.

@riqbal-k
Created October 16, 2022 13:14
Show Gist options
  • Save riqbal-k/e995814728654bb3f937a47212e84410 to your computer and use it in GitHub Desktop.
Save riqbal-k/e995814728654bb3f937a47212e84410 to your computer and use it in GitHub Desktop.
require(zoo)
#Microsoft
ms$Dates <- as.Date(ms$Dates, "%d/%m/%Y")
class(ms$Dates)
ms.z = zoo(x=ms$Close, order.by=ms$Dates)
#S and P 500
sp$Dates <- as.Date(sp$Dates, "%d/%m/%Y")
class(sp$Dates)
sp.z = zoo(x=sp$Close, order.by=sp$Dates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment