Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:27:29+00:00 2026-06-17T09:27:29+00:00

I am programming a heatmap in R based on a csv file. This contains

  • 0

I am programming a heatmap in R based on a csv file. This contains the following information:

NAME,metformin,metformin,phenformin,phenyl biguanide,metformin,estradiol
Adenocarcinoma of lung,0,0,0,-1.834006462,1.715939688,0
Adenocarcinoma of lung,1.995916353,0,0,0,0,0
Thymic carcinoma,1.154056722,1.106488961,0,1.145126548,0,-1.14095315
alpha-1-Antitrypsin deficiency,0,0,0,0,-1.917025669,-1.974151858

So I want to create a heatmap in which in the name of the rows appears the labels: Adenocarcinoma of the lung, Adenocarcinoma… etc. I am doing this steps:

hm<-read.csv("heatmap1.csv",sep=",")
row.names(hm)<-hm$NAME
hm<-hm[,2:7]
hm_matrix<-data.matrix(hm)
heatM<-heatmap(hm_matrix, Rowv=NA, Colv=NA, col = cm.colors(256), scale="column", margins=c(5,10))

The problem I got is in the line that says:

row.names(hm)<-hm$NAME

Error in `row.names<-.data.frame`(`*tmp*`, value = c(1L, 1L, 3L, 2L)) : 
  duplicate 'row.names' are not allowed

I know that I have a duplicated name, but I really need that data appears in the heatmap because the measure levels (the quantities) are different even if they are from the same disease.

Thanks for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:27:29+00:00Added an answer on June 17, 2026 at 9:27 am

    You can use make.unique to make unique versions of the names

    row.names(hm) <-  make.unique(as.character(hm$NAME))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Programming In Scala explains that tuples' _N numbers are one-based, instead of zero-based, because
Programming novice here. I'm trying to allow a user to enter their name, firstName
(Programming Language: PHP v5.3) I am working on this website where I make search
This may be a math question more than a programming question, but we'll see.
programming languages are grouped it 2 main classes Dynamic & Static. - Is this
while programming throughout the years I have never posted a question on this website,
In Programming Perl -w file-test operator described as: –w File is writable by effective
In programming you can use the this keyword this.Textbox or just Textbox What is
assembly programming in Emacs how to? I want Emacs to do following things 1.
While programming for iOS I encountered the following scenario: I have a singleton class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.