I am trying to compute distances in R, but in my data frame the first variable (column) is a ID, for example I have this:
rownames ID Amount1 1 0015 15 2 9812 25 3 1672 89
I would like to have something like this:
rownames Amount1 0015 15 9812 25 1672 89
Just use :
rownames(df) <- df$ID
Note that row names have to be unique if df is a data frame.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With