Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
line_list <- list()
for(i in 1:nrow(line_dat)){
line_color <- ifelse(line_dat$signal[i] == 'buy', 'green', 'red')
line_list[[i]] <- list(type = "line",
fillcolor = line_color, line = list(color = line_color), opacity = 0.3,
x0 = line_dat[[1]][i], x1 = line_dat[[1]][i], xref = "x",
y0 = 0, y1 = line_dat[[2]][i], yref = "y")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment