R make.unique starting in 0
0
0
Entering edit mode
20 months 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.

R • 394 views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1643 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