making a factor numeric
1
0
Entering edit mode
Angel ▴ 40
@angel-7981
Last seen 7.7 years ago
Berlin

hi,

i have a file contains gene name and length, like below

> genes <- as.data.frame(read.csv("geneID and length.txt",header = FALSE, sep=","),stringsAsFactors=FALSE)
> head(genes[1:2])
       V1          V2
1 genesID geneslength
2  R0010W        1272
3  R0020C        1122
4  R0030W         546
5  R0040C         891
6 YAL069W         315

genesID <- genes[,1]
geneslength <- genes[,2]

i used ncol=(as.integer(max(geneslength) but 

error

Error in Summary.factor(c(1368L, 115L, 53L, 1135L, 1317L, 776L, 593L,  : 
  ‘max’ not meaningful for factors

how i can make geneslength numeric please??

thank you

software error • 718 views
ADD COMMENT
2
Entering edit mode
Angel ▴ 40
@angel-7981
Last seen 7.7 years ago
Berlin

genes <- as.data.frame(read.csv("geneID and length.csv", sep=","),stringsAsFactors=FALSE)

ADD COMMENT

Login before adding your answer.

Traffic: 593 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6