I have an example matrix that looks as follows:
Unstim Unstim.1 Unstim.2 Unstim.3 Unstim.4
BB100 330 175 576 290 203
BB104 320 194 803 325 211
BB110 274 141 379 351 419
BB112 295 187 512 363 210`
I hope to group the row names into groups for example BB100 and BB104 would be in "SLE" and BB110 BB112 would be in "RA" but without adding a column to the matrix because I hope to put the matrix into the qgraph function. Ideally, the "SLE", "RA" etc. groups would be in a vector that would allow me to run
qgraph(cor(matrix), groups = group)
I'm hoping this would allow me to visualize a correlation matrix with the groups identified.
I'm new to R so sorry if this has been answered but I've been trying to find an answer all day but I just can't seem to find one Thanks in advance