Description Usage Arguments Value Examples
View source: R/c_array_as_df.R
Converts the C history array from the mELO output to a data.frame. Useful for plotting diagnostics.
1 | c_array_as_df(c_mat_array)
|
c_mat_array |
The history of C matrix values for a mELO rating model. |
A data.frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # rock paper scissors fire water model
rpsfw_model <- mELO(rpsfw_df, k=2)
c_mat_df <- c_array_as_df(rpsfw_model$c_mat_history)
head(c_mat_df)
# Plot the evolution of C vectors for each throw
# Make data a bit 'tidyer'
tidy_c_mat_df <- tidyr::gather(
c_mat_df,
key = "C",
value = "value",
-time, -Player
)
ggplot2::ggplot(tidy_c_mat_df, ggplot2::aes(x=time,y=value,colour=C)) +
ggplot2::geom_line(size=1.25) +
ggplot2::facet_wrap(~Player)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.