Hi,

I have a raw counts file extracted by featurecounts tool and also a gene length matrix. I was going to count rpkm for my 76 samples then I did like below

```r
rawcounts <- read.table("rawcounts.txt", header = T, sep = "\t")
head(rawcounts[,1:4])
     Geneid SRR018347 SSR019035 SRR074122
1 AT1G01010        31        37         4
2 AT1G01020       153       211        19
3 AT1G01030        10        13         0
4 AT1G01040        88       106         3
5 AT1G01046         0         0         0
6 AT1G01050       228       272       195

dim(rawcounts)
[1] 33602    77

gene-length <- read.table("gene-length.txt")
head(gene-length[,1:4])
       V1   V2   V3   V4
V1 Length 1688 1774 1905

dim(gene-length )
[1]     1 33603

d <- DGEList(counts=rawcounts)
cpm(d)
cpm(d,log=TRUE)

d$genes$Length <- gene-length
rpkm(d)

Warning message:
In Ops.factor(left, right) : '/' not meaningful for factors
```

Even I tried with transposed gene length matrix but again I got error

What is my fault please?
The short code I used to counts rpkm with edgeR package

```r
# rpkm normalization by edgeR package
# I need a file containing gene length that I extracted from featurecounts tool output
# reading gene length file
mycounts1 <- read.csv("length.txt", stringsAsFactors = FALSE)
# read as numeric
mycounts1 <- as.numeric(mycounts1$Length)
# transposing the gene length file
tmycounts1 <- t(mycounts1)
# setting as numeric
sapply(tmycounts1, class)
# reading the rawcounts file
mycounts <- read.table("rawcounts.txt", header = T, sep = "\t")
# watching the head of uploaded file
head(mycounts[,1:4])
# watching the dimension of matrix
dim(mycounts)
# assigning the column one as mycounts rowname
rownames(mycounts)<- mycounts[,1]
# read as matrix
as.matrix(mycounts)
# viewing mycounts class
class(mycounts)
# setting as numeric
sapply(mycounts, class)
# removing the column on
mycounts <- mycounts[,-1]
# watching the head of rawcounts file
head(mycounts[,1:4])
# applying edgeR function
library(edgeR)
# assigning the rawcounts to a new variable
d <- DGEList(counts=mycounts)
# reading gene length file as a matrix
d$genes$Length <- c(tmycounts1)
# rpkm function
mycounts <- rpkm(d)
# writing the result
write.table(mycounts, file = "rpkm.txt", dec = ".", sep = "\t", quote = FALSE)
```