library(zFactor)
smx <- stats_of_z.stats(stat = "MAPE")
smx
sdf <- as.data.frame(smx)
row_names <- rownames(sdf)
sdf <- cbind(row_names, sdf)
rownames(sdf) <- NULL
sdf$row_names <- as.character(sdf$row_names)
names(sdf)[1] <- "stat"
sdf
tidy_stats <- tidyr::gather(sdf, "corr", "stats", 2:ncol(sdf))
tidy_stats
ggplot(tidy_stats, aes(x = corr, y = stats)) + 
    geom_boxplot() + scale_y_log10()
ggplot(tidy_stats, aes(x = corr, y = stats, color = corr)) + 
    geom_point() + 
    facet_grid(. ~ stat, scales = "free_y")
ggplot(subset(tidy_stats, stat =="Mode"), aes(x = corr, y = stats)) + geom_point()
g <- ggplot(tidy_stats, aes(x=stats, y=stats, group=corr, color=corr))
g + geom_
t <- ggplot(tidy_stats, aes(x=stats, y=stats, color=corr)) + 
    geom_point() + facet_grid(.~ stat, scales = "free_y")

print(t)

# convert to dataframe
mat <- cbind(rownames(smx), smx)
rownames(mat) <- NULL
df <- as.data.frame(mat)
df <- as.double(df[,2:])
as.double(df[, 2:ncol(df)])


f0nzie/zFactor documentation built on Aug. 2, 2019, 1:42 a.m.