Dragging a column to the leftmost

36 Views Asked by At

I am a newbie on R and my question may be too simple. I am trying to draw a hierarchical cluster. I use readxl to read the data from a xlsx file. The dendextend package also includes the year column to calculations. I want to drag the year column to leftmost as seen in this picture

1

There are 1 best solutions below

1
On

Assuming you want to create rownames from the year column (for whatever reason), you can just use

rownames(your_df) <- your_df$Year