[R] qgraph: correlation matrix variable names

Sacha Epskamp mail at sachaepskamp.com
Mon Apr 8 17:58:10 CEST 2013


Hi Torvon,

In R you can specify rownames and columnames to a matrix, which in
essence becomes what you describe as first row and first column,
except they are not actually rows or columns (so that the matrix is
still numeric). qgraph will extract labels from these rownames. You
can also use the labels argument in qgraph to give a vector with a
label for each variable.

Best, Sacha

---
Sacha Epskamp, MSc
Department of Psychological Methods
University of Amsterdam
Weesperplein 4, room 2.05
1018 XA Amsterdam
The Netherlands
http://www.sachaepskamp.com


2013/4/8 Torvon <torvon at gmail.com>:
> We aim to visualize a 17*17 correlation matrix with the package *qgraph*,
> consisting of 16 variables.
>
> Without variable names in the input file, that works perfectly
>
> R> qgraph(data)
>
> but we'd like variable names instead of numbers for variables.
>
> In a correlation matrix, the first row and the first column usually have
> variable names. We've been unsuccessful so far to read such a file into
> qgraph, and haven't found to manually assign names to variables in qgraph.
>
> Would you know of a solution to this problem?
>
> Thank you,
>  Torvon
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list