This is because the R language default behavior is a unique identifier
Duplicate lines need to be removed
This is very common in differential expression, because different IDs may correspond to the same gene_ symbol
genes_sig <- res_sig %>%
arrange(adj.P.Val) %>% #Sort by Pvalue from smallest to largest
as tibble() %>%
column_to_rownames(var = "gene_symbol")
report errors
Error in `.rowNamesDF<-`(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘’, ‘ AMY2A ’, ‘ ANKRD20A3 ’, ‘ ANXA8 ’, ‘ AQP12B ’, ‘ AREG ’, ‘ ARHGDIG ’, ‘ CLIC1 ’, ‘ CTRB2 ’, ‘ DPCR1 ’, ‘ FAM72B ’, ‘ FCGR3A ’, ‘ FER1L4 ’, ‘ HBA2 ’, ‘ HIST1H4I ’, ‘ HIST2H2AA4 ’, ‘ KRT17P2 ’, ‘ KRT6A ’, ‘ LOC101059935 ’, ‘ MRC1 ’, ‘ MT-TD ’, ‘ MT-TV ’, ‘ NPR3 ’, ‘ NRP2 ’, ‘ PGA3 ’, ‘ PRSS2 ’, ‘ REEP3 ’, ‘ RNU6-776P ’, ‘ SFTA2 ’, ‘ SLC44A4 ’, ‘ SNORD116-3 ’, ‘ SNORD116-5 ’, ‘ SORBS2 ’, ‘ TNXB ’, ‘ TRIM31 ’, ‘ UGT2B15 ’
Try to use the duplicated() function
res_df = res_df[!duplicated(res_df),] %>% as.tibble() %>%
column_to_rownames(var = "gene_symbol")
Still not?Duplicated removing duplicate values still shows that duplicate values exist
Error in `.rowNamesDF<-`(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘ AMY2A ’, ‘ ANKRD20A3 ’, ‘ ANXA8 ’, ‘ AQP12B ’, ‘ AREG ’, ‘ ARHGDIG ’, ‘ CLIC1 ’, ‘ CTRB2 ’, ‘ DPCR1 ’, ‘ FAM72B ’, ‘ FCGR3A ’, ‘ FER1L4 ’, ‘ HIST1H4I ’, ‘ HIST2H2AA4 ’, ‘ KRT17P2 ’, ‘ KRT6A ’, ‘ LOC101059935 ’, ‘ MT-TD ’, ‘ MT-TV ’, ‘ NPR3 ’, ‘ NRP2 ’, ‘ PGA3 ’, ‘ PRSS2 ’, ‘ REEP3 ’, ‘ RNU6-776P ’, ‘ SFTA2 ’, ‘ SORBS2 ’, ‘ TRIM31 ’, ‘ UGT2B15 ’
Another way is to use the uniqe function of the dyplr package
res_df = res_df %>% distinct(gene_symbol,.keep_all = T) %>% as.tibble() %>%
column_to_rownames(var = "gene_symbol")
Successfully solved
Read More:
- R Language Error: variable does not have limits defined by datadist
- [Solved] R Language Error: Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error)
- R language: How to Solve DMwR Install Error
- R Language: How to Solve featureplot function Error
- R language Use setwd() function Error [How to Solve]
- [Solved] R Language Error: Discrete value supplied to continuous scale
- Angular select Tag Error trying to diff ‘2’. Only arrays and iterables are allowed
- R language learning problem solving error in output $nodeid: $operator is invalid for atomic vectors
- [Solved] R Language Error: Error in file(out, “wt“) : cannot open the connection
- [Solved] Opencv Compile Error: (CMake Error: The following variables are used in this project, but they are set to not)
- [Solved] Unity Error: “Not allowed to access vertices on mesh”
- Fuseki failed with message “Parse error: [line:1, col: 1] Content is not allowed in prolog.“
- Error: could not find function … in R [How to Solve]
- error A2031: gisters not allowed [How to Solve]
- [Solved] Android Error: java.lang.IllegalStateException: Not allowed to start service Intent
- [How to Fix] manual close is not allowed over a Spring managed SqlSession
- [GO]Solve request origin not allowed by Upgrader.CheckOrigin websocket cross-domain
- JSON parse error: raw timestamp (1595952000000) not allowed for
- [Solved] HTTP Error 405.0-Method Not Allowed occurs in the Put operation of the REST service on IIS7.5
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed