use diffrnet color in dygraphs for simulation in R

23 Views Asked by At

I am using GBM mode for simulation with following code, I am trying to use dygraphs in R instead of ggplot, and wanted to achieve a different color for each simulation path, but I am just getting one color, any idea how we have different color for each line?

Thank you

library(tidyquant)
library(dplyr)
library(timetk)
library(dygraphs)
library(healthyR.ts)

# Load the data
df <- FANG %>%
  filter(symbol == "FB") %>%
  select(symbol, date, adjusted) %>%
  filter_by_time(.date_var = date, .start_date = "2016-01-01") 


# Create Original Simulation Plot
df %>%
  ts_brownian_motion_augment(
         .date_col = date,
         .num_sims = 100,
         .time = 100,
         .value_col = adjusted,
         .delta_time = 1
       ) %>%
dygraph() %>% 
     dySeries("sim_number", drawPoints = TRUE, color = "blue") %>%
     dyRangeSelector()  


0

There are 0 best solutions below