The `rownames()` method in R is used to rename and replace the row names of a matrix-like object (incl. data frames) .
Questions tagged [r-rownames]
113 questions
0
votes
3 answers
how to edit row names in dataframe from list of lists?
I'm new to R (I've tried searching; sorry if this is repeated elsewhere!) and I need some help please! I'm trying to edit the row names in a data.frame:
I start with several vcf files and create a list of lists using lapply() then flatten the…

rshraim
- 15
- 6
0
votes
1 answer
How to create a dataset from an Excel containing row and column names in R?
I have 2 .csv files that are transformed from Excel tables. Their row and column names are same but they contain different data. When I write table1<-read.csv("table1.csv",header=TRUE) and table2<-read.csv("table2.csv",header=TRUE), row names are…

cocomat
- 75
- 1
- 1
- 3
0
votes
1 answer
How to properly assign row names to ("mts", "ts", "matrix") object in R?
I want to assign row names to a ("mts", "ts", "matrix") object:
library(lubridate)
library(zoo)
myVAR <- cbind(ts(rnorm(64,0,1)),ts(rnorm(64,0,1)),ts(rnorm(64,0,1)), ts(rnorm(64,0,1)))
class(myVAR) # "mts" "ts" "matrix"
dim(myVAR) #…

Erdogan CEVHER
- 1,788
- 1
- 21
- 40
0
votes
1 answer
R: How to keep row names with rbind on a data table
I'm losing the row names of the data. It appears to happen when the rbind function is used on a data table.
Here's an example showing what should happen
library(data.table)
allData <- NULL
for (itest in seq(3)) {
pts <- NULL
npts <- 4
for…
user974465
0
votes
2 answers
R data frame row name shows matrix instead of numeric value
I have the following to create a data frame. My problem is that the data frame row names display as [1,],[2,],[3,],[4,], etc instead of just 1,2,3,4,etc (see below for outputs). Why and how can I fix this to just have my row names show as usual…

mo_maat
- 2,110
- 12
- 44
- 72
-1
votes
1 answer
duplicate 'row.names' are not allowed - R
So, I am new in R and trying to implement a differential gene expression analysis.
I'm trying to store gene names as rownames so that I can create a DGEList object.
asthma <- read.csv("Asthma_3 groups-Our study gene expression.csv")
head(asthma,…

arn
- 1
-1
votes
2 answers
R: NA returned despite !is.na
I have a simple data frame:
> df <- data.frame(i=c(1:20), x=c(1:10, rep(NA, 10)))
> df
i x
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
11 11 NA
12 12 NA
13 13 NA
14 14 NA
15 15 NA
16 16 NA
17 17…

oepix
- 151
- 2
- 12