Visualize estimated correlation matrix as a network
Source:R/visualization_utilities.R
plot_estimated_cor_network.Rd
Based on approximation via simulation specified by given simulation design.
Convenience wrapper for combining estimate_final_correlation
and
plot_cor_network
.
Usage
plot_estimated_cor_network(
obj,
n_obs = 1e+05,
cor_type = "pearson",
seed = NULL,
show_categorical = TRUE,
return_network = FALSE,
...
)
Arguments
- obj
S3 class object of type
simdesign
(or inheriting from it).- n_obs
Number of observations to simulate.
- cor_type
Can be either a character (
pearson
,spearman
,kendall
) which is passed tostats::cor
or a function, which is directly used to compute the correlation matrix on the simulated data. Such a function is expected to take a single input matrix (and possibly other arguments which can be set via...
) and output a single matrix.- seed
Random number seed. NULL does not change the current seed.
- show_categorical
If TRUE, marks categorical variables differently from numeric ones. Determined by the
types_final
slot of theobj
argument.- return_network
If TRUE, the
igraph
network object is returned and can be plotted by the user using e.g. the interactiveigraph::tkplot
function.- ...
Passed to
plot_cor_network
.
Value
If return_network
is TRUE
, then an igraph
network object is returned
that can be plotted by the user using e.g. the interactive
igraph::tkplot
function. Otherwise, the network
object is plotted directly and no output is returned.
Details
This function is useful to estimate the correlation network of a simulation
setup after the initial underlying distribution Z
has been transformed to
the final dataset X
.