How to reorder column vectors in r to use for heatmap.2
0
0
Entering edit mode
6.7 years ago
Björn ▴ 110

I have a column (country) with vectors in a file xyz which is a data.frame

    Country
Germany
Switzerland
Germany
Germany
Switzerland

How can I reorder it to same countries.

Germany
Germany
Germany
Switzerland
Switzerland

The reordering must generate two distinct columns in heatmap.2

heatmap.2 vector column • 2.4k views
ADD COMMENT
0
Entering edit mode
sort(xyz$country)

By default it will be sorted from A to Z

ADD REPLY
0
Entering edit mode

It reorders the vectors but not in the heatmap.

ADD REPLY
0
Entering edit mode

Would you please show us the heatmap you are talking about following this process please : How to add images to a Biostars post

ADD REPLY

Login before adding your answer.

Traffic: 1880 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6