This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R make.unique starting in 0

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.

r

I guess you can run make.uniqe and then change the labels that weren't changed by make.unique and add .0 to them.

yes, but the problem is that some numbers has already exist after sample names

0 answers

No answers yet.

Log in to answer this question.