plot.IconoCorel: Clean the dataframe before to be used with...

View source: R/plot.IconoCorel.R

plot.IconoCorelR Documentation

Clean the dataframe before to be used with IC_threshold_matrix

Description

This function plots the data as a network. It returns an invisible object that can be used with visIgraph from package visNetwork. https://fr.wikipedia.org/wiki/Iconographie_des_corrélations

Usage

## S3 method for class 'IconoCorel'
plot(
  x,
  ...,
  show.legend.direction = "bottomright",
  show.legend.strength = "topleft",
  title = "Correlation iconography",
  vertex.label.color = "black",
  vertex.label = NULL,
  vertex.color = "white",
  vertex.label.cex = 1,
  plot = TRUE
)

Arguments

x

The correlation matrix to show

...

other options of plot.igraph()

show.legend.direction

the position of the legend of direction; FALSE to not show it

show.legend.strength

the position of the legend with intensity of correlation; FALSE to not show it

title

the title of the plot

vertex.label.color

a vector with the colors of labels

vertex.label

a vector with the labels

vertex.color

a vector of colors

vertex.label.cex

a vector of cex

plot

if TRUE, the plot is shown

Details

plot.IconoCorel checks and corrects the dataframe to be used with IC_threshold_matrix

Value

A igraph object

Author(s)

Marc Girondot marc.girondot@gmail.com

References

Lesty, M., 1999. Une nouvelle approche dans le choix des régresseurs de la régression multiple en présence d’interactions et de colinéarités. Revue de Modulad 22, 41-77.

See Also

Other Iconography of correlations: IC_clean_data(), IC_correlation_simplify(), IC_threshold_matrix()

Examples

## 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 <- IC_clean_data(es, debug = TRUE)
cor_matrix <- IC_threshold_matrix(data=df, threshold = NULL, progress=FALSE)
cor_threshold <- IC_threshold_matrix(data=df, threshold = 0.3)
par(mar=c(1,1,1,1))
set.seed(4)
library("igraph")
library("visNetwork")
kk <- plot(cor_threshold, vertex.color="red")
# it can be shown also with the visNetwork package
visIgraph(kk)
cor_threshold_Note <- IC_correlation_simplify(matrix=cor_threshold, variable="Note")
plot(cor_threshold_Note)

# You can record the position of elements and use them later
ly <- layout_nicely(kk)
plot(cor_threshold, vertex.color="red", layout=ly)

## End(Not run)

HelpersMG documentation built on Oct. 5, 2023, 5:08 p.m.