简体   繁体   中英

removing gene duplicates from heatmap in r

I have drawn heat maps from microarray expression data set and in the heatmaps I see duplicates and triplicates for many of the genes I am interested

I am very new to R and is there a way to remove these duplicates or triplicates of genes

For example I see name of one gene say (BMP1) 2 or 3 times in the heatmap

Kindly suggest me with some solutions

Regards Ram

I try to guess your answer, but it will be better if you give an example of your problem:

> tmp <- data.frame("numbers" = 1:3, "letters" = letters[1:3])
> tmp
  numbers letters
1       1       a
2       2       b
3       3       c
> tmp <- rbind(tmp,tmp)
> tmp
  numbers letters
1       1       a
2       2       b
3       3       c
4       1       a
5       2       b
6       3       c
> unique(tmp)
  numbers letters
1       1       a
2       2       b
3       3       c

From the base help unique returns a vector, data frame or array like x but with duplicate elements/rows removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM