# Melt each data frame within the list generated by 7ReplicateWrapper.R. Now we
# have a set of 10 graphs for each parameter situation configuration. Our next
# task is to assess equivalency between our results and Nelson and Van Zyl's
# results. We already see that the New SY method and SY are too close for
# comfort. The NewSY method needs to be error-checked.

combineMeltClean <- function(df_ls){
  # Combine and melt the data into one df
  melted_df <- df_ls %>% ldply() %>% melt()
  # Rename the .id column as target dimension
  melted_df <- melted_df %>% rename_(TargetDim = ".id")
  # Transform the data from probability of correct lcassification to probability
  # of misclassification.
  melted_df <- melted_df %>% mutate(PMC = value) %>% dplyr::select(-value)

  # We need to add  bars for summary stats
  PMCSummary <- melted_df %>%
    filter(TargetDim == "n10") %>%
    dplyr::select(PMC) %>%
    as.matrix %>%
  melted_df$Median <- PMCSummary["Med"]
  # Finally, remove the dimension "n10". This information is the same for all
  # methods, so it is redundant. We will add the "Median" value to the graph as
  # a comparison bar.
  melted_df %>% filter(TargetDim != "n10")
BenBarnard/slidR documentation built on Jan. 2, 2018, 4:32 p.m.