Skip to content

Instantly share code, notes, and snippets.

@alexhallam
Created May 18, 2018 16:13
Show Gist options
  • Save alexhallam/4580fb0bf0167d9685413c287a4a4b38 to your computer and use it in GitHub Desktop.
Save alexhallam/4580fb0bf0167d9685413c287a4a4b38 to your computer and use it in GitHub Desktop.
rolling averages
tq_mutate(select = usd,mutate_fun = rollapply,FUN = mean,width = 13,
col_rename = "roll13") %>%
tq_mutate(select = usd,mutate_fun = rollapply,FUN = mean,width = 2,
col_rename = "roll2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment