Entering edit mode
2.2 years ago
bhbh
▴
30
I have a data frame with columns that are in groups of 4 like so:
us.sample4, us.sample4, us.sample4, us.sample4, nz.sample3,nz.sample3, ch.sample4, ....
I would like to get:
us.sample4.0, us.sample4.1, us.sample4.2, nz.sample3.0 ,nz.sample3.1, ch.sample4.0
Is there an easy way to accomplish this? In the make.unique
documentation does not mention any parameters to obtain this behaviour.
I guess you can run
make.uniqe
and then change the labels that weren't changed bymake.unique
and add.0
to them.yes, but the problem is that some numbers has already exist after sample names