# NOT RUN {
library("HelpersMG")
es <- structure(list(Student = c("e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8"),
Mass = c(52, 59, 55, 58, 66, 62, 63, 69),
Age = c(12, 12.5, 13, 14.5, 15.5, 16, 17, 18),
Assiduity = c(12, 9, 15, 5, 11, 15, 12, 9),
Note = c(5, 5, 9, 5, 13.5, 18, 18, 18)),
row.names = c(NA, -8L), class = "data.frame")
es
df_clean <- IC_clean_data(es, debug = TRUE)
cor_matrix <- IC_threshold_matrix(data=df_clean, threshold = NULL, progress=FALSE)
cor_threshold <- IC_threshold_matrix(data=df_clean, threshold = 0.3)
plot(cor_threshold, show.legend.strength=FALSE, show.legend.direction = FALSE)
cor_threshold_Note <- IC_correlation_simplify(matrix=cor_threshold, variable="Note")
plot(cor_threshold_Note)
cor_threshold <- IC_threshold_matrix(data=df_clean, threshold = 0.8, progress=FALSE)
gr <- plot(cor_threshold, plot=FALSE)
ly <- getFromNamespace("layout_nicely", ns="igraph")(gr)
plot(cor_threshold,
layout=matrix(data=c(53, 53, 55, 55,
55, 53, 55, 53), ncol=2, byrow=FALSE),
show.legend.direction = FALSE,
show.legend.strength = FALSE, xlim=c(-2, 2), ylim=c(-2, 2))
# Using significance level
cor_threshold <- IC_threshold_matrix(data=df_clean, threshold = 0.3,
significance.level=0.05)
plot(cor_threshold, show.legend.strength=FALSE, show.legend.direction = FALSE)
cor_threshold_Note <- IC_correlation_simplify(matrix=cor_threshold, variable="Note")
plot(cor_threshold_Note)
# Using the model All at a time
cor_threshold_AAT <- IC_threshold_matrix(data=df_clean, threshold = 0.3, model="AAT")
par(mar=c(1,1,1,1))
set.seed(4)
plot(cor_threshold_AAT, show.legend.strength="bottomleft")
############
dta <- structure(list(Student = c("e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8"),
Mass = c(52, 59, 55, 58, 66, 62, 63, 69),
Age = c(12, 12.5, 13, 14.5, 15.5, 16, 17, 18),
Assiduity = c(12, 9, 15, 5, 11, 15, 12, 9),
Note = c(5, 5, 9, 5, 13.5, 18, 18, 18)),
row.names = c(NA, -8L), class = "data.frame")
dta0 <- dta[, 2:ncol(dta)]
ic0 <- IC_threshold_matrix(data = dta0)
cor_threshold <- IC_threshold_matrix(data=ic0, threshold = 0.3)
par(mar=c(1,1,1,1))
set.seed(4)
library("igraph")
plot(cor_threshold, vertex.color="red", show.legend.strength = FALSE)
plot(IC_correlation_simplify(matrix=cor_threshold),
show.legend.strength = FALSE, show.legend.direction = FALSE)
# }
Run the code above in your browser using DataLab