This is a test version of Biostars. For the public version, visit https://www.biostars.org.
[Solved] Force duplication for row names in R

Dear everyone I want to set duplication names in row names of data frame in R, could some one guide me how to do this? for example I want to set "A1BG" for the first 10 rows of data frame "Gene_table".

Your help is really appreciated!

r

This is not possible, and has been addressed many times before:

See: - How To Deal With Duplicate Row Names Error In R - https://stackoverflow.com/questions/8854046/duplicate-row-names-are-not-allowed-error-in-r-programming

for some solutions.

From the documentation:

A data frame has (by definition) a vector of _row names_ which has length the number of rows in the data frame, and contains neither missing nor duplicated values. Where a row names sequence has been added by the software to meet this requirement, they are regarded as ‘automatic’.

Hello landscape95!

We believe that this post does not fit the main topic of this site.

Not a strongly bioinformatics related problem.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

Dear Michael, I found the solution that the data should be converted to matrix type (as.matrix), so it will be easier to coerce the data's col/rownames with duplications. I just reply this as an answer for who looks for the answer! You can keep this topic closed. Thank you!

0 answers

No answers yet.

Log in to answer this question.