Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- random_index <- floor(runif(10000, 1, 1e6+1))
- random_cluster <- results[[6]]$cluster[random_index]
- random_pred_matrix <- pred_matrix[random_index, ]
- dates_subse_after_pred <- rdn_num[rm_na_pred_df]
- random_res <- cbind(random_pred_matrix, random_cluster)
- random_res <- t(random_res)
- random_res <- cbind(c(dates_subse_after_pred, 1), random_res)
- df_1 <- data.frame(random_res[1:250,c(TRUE, random_cluster==1)])
- df_2 <- data.frame(random_res[1:250,c(TRUE, random_cluster==2)])
- df_3 <- data.frame(random_res[1:250,c(TRUE, random_cluster==3)])
- df_4 <- data.frame(random_res[1:250,c(TRUE, random_cluster==4)])
- df_5 <- data.frame(random_res[1:250,c(TRUE, random_cluster==5)])
- df_6 <- data.frame(random_res[1:250,c(TRUE, random_cluster==6)])
- df_1.long <- melt(df_1, id.vars = 1)
- df_1.long$X1 <- as.Date(df_1.long$X1)
- df_2.long <- melt(df_2, id.vars = 1)
- df_2.long$X1 <- as.Date(df_2.long$X1)
- df_3.long <- melt(df_3, id.vars = 1)
- df_3.long$X1 <- as.Date(df_3.long$X1)
- df_4.long <- melt(df_4, id.vars = 1)
- df_4.long$X1 <- as.Date(df_4.long$X1)
- df_5.long <- melt(df_5, id.vars = 1)
- df_5.long$X1 <- as.Date(df_5.long$X1)
- df_6.long <- melt(df_6, id.vars = 1)
- df_6.long$X1 <- as.Date(df_6.long$X1)
- ggplot(df_1.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "lightblue")
- ggplot(df_2.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "blue")
- ggplot(df_3.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "lightgreen")
- ggplot(df_4.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "green")
- ggplot(df_5.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "pink")
- ggplot(df_6.long) +
- geom_line( aes(x = X1, y= value, group = variable), color = "red")
Add Comment
Please, Sign In to add comment