[R] rotate column names in large matrix

Joshua Wiley jwiley.psych at gmail.com
Mon Nov 15 19:48:11 CET 2010


Hi Lara,

Hmm, I've never seen column names rotated in R (certainly you could in
graphics, etc. and this should do it in that case:
lapply(strsplit(colnames(x), ''), paste, collapse = "\n")  ).  You
could transpose the matrix so the columns become the rows and then
just have numbers (1:1600) as the columns?  That's the best solution
I've found when dealing with large correlation matrices.  I also
usually set options(digits = 2) or thereabouts (or use round() ).  I'd
be interested in seeing any other ideas people have also as this has
been troublesome to me in the paste some too.  As much as I hate to
say it, I find it easier to view some of these things in Excel (you
can just write the matrix to the clipboard and paste into Excel or
probably open office (though I have not tried)) because it has easy
scrolls bars and zooming.

Cheers,

Josh

On Mon, Nov 15, 2010 at 9:47 AM, Lara Poplarski <larapoplarski at gmail.com> wrote:
> Dear List,
>
>
> I have a large (1600*1600) matrix generated with symnum, that I am using to
> eyeball the structure of a dataset.
>
>
> I have abbreviated the column names with the abbr.colnames option. One way
> to get an even more compact view of the matrix would be to display the
> column names rotated by 90 degrees.
>
>
> Any pointers on how to do this would be most useful. Any other tips for
> displaying the matrix in compact form are of course also welcome.
>
>
> Many thanks,
>
> Lara
>
>        [[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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list