View source: R/plotAnimatedFlowmap.R
plotAnimatedFlowmap | R Documentation |
This is the main function for generating flow maps and animations based on transition probabilities including self states and excluding self states. Flow maps are a type of data visualization used to represent the transition probability of different states. Animations are the gifs used to represent the movement of data through the cells.
plotAnimatedFlowmap(
hvt_model_output,
transition_probability_df,
df,
flow_map = "All",
cellid_column,
time_column
)
hvt_model_output |
List. Output from a trainHVT function. |
transition_probability_df |
List. Output from getTransitionProbability function |
df |
Data frame. The input dataframe should contain two columns, cell ID from scoreHVT function and time stamp of that dataset. |
flow_map |
Character. Type of flow map ('self_state', 'without_self_state', 'All' or NULL) |
cellid_column |
Character. Name of the column containing cell IDs. |
time_column |
Character. Name of the column containing time stamps |
A list of flow maps and animation gifs.
PonAnuReka Seenivasan <ponanureka.s@mu-sigma.com>, Vishwavani <vishwavani@mu-sigma.com>
trainHVT
scoreHVT
getTransitionProbability
dataset <- data.frame(date = as.numeric(time(EuStockMarkets)),
DAX = EuStockMarkets[, "DAX"],
SMI = EuStockMarkets[, "SMI"],
CAC = EuStockMarkets[, "CAC"],
FTSE = EuStockMarkets[, "FTSE"])
hvt.results<- trainHVT(dataset,n_cells = 60, depth = 1, quant.err = 0.1,
distance_metric = "L1_Norm", error_metric = "max",
normalize = TRUE,quant_method = "kmeans")
scoring <- scoreHVT(dataset, hvt.results)
cell_id <- scoring$scoredPredictedData$Cell.ID
time_stamp <- dataset$date
dataset <- data.frame(cell_id, time_stamp)
table <- getTransitionProbability(dataset, cellid_column = "cell_id",
time_column = "time_stamp")
plots <- plotAnimatedFlowmap(hvt_model_output = hvt.results,
transition_probability_df = table,df = dataset,
flow_map = 'All',cellid_column = "cell_id", time_column = "time_stamp")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.