Name: Anonymous 2013-03-25 18:56
okay i have a datafile like this
chr01.fsa 43109 44002 MACS_peak_1 200.81
chr01.fsa 45489 46376 MACS_peak_2 298.26
chr01.fsa 67930 70674 MACS_peak_3 2769.45
chr01.fsa 138889 139895 MACS_peak_4 60.97
etc.
and basically when I read the table, the numeric columns are treated as character vectors
trying the following
bed1<-read.table('myfile.txt',sep='\t')
apply(bed1,2,class)
V1 V2 V3 V4 V5
"character" "character" "character" "character" "character"
wtf? columns 2,3,and 5 are clearly numeric.
i try to force them to numeric
transform(bed1,V2=as.numeric(V2),V3=as.numeric(V3))
apply(bed1,2,class)
V1 V2 V3 V4 V5
"character" "character" "character" "character" "character"
It doesn't do a thing! I have also tried stringsAsFactors, colClasses, and they do not change my results
Here's the whole datafile i am totally out of ideas
http://pastebin.com/YqFNpBPQ
chr01.fsa 43109 44002 MACS_peak_1 200.81
chr01.fsa 45489 46376 MACS_peak_2 298.26
chr01.fsa 67930 70674 MACS_peak_3 2769.45
chr01.fsa 138889 139895 MACS_peak_4 60.97
etc.
and basically when I read the table, the numeric columns are treated as character vectors
trying the following
bed1<-read.table('myfile.txt',sep='\t')
apply(bed1,2,class)
V1 V2 V3 V4 V5
"character" "character" "character" "character" "character"
wtf? columns 2,3,and 5 are clearly numeric.
i try to force them to numeric
transform(bed1,V2=as.numeric(V2),V3=as.numeric(V3))
apply(bed1,2,class)
V1 V2 V3 V4 V5
"character" "character" "character" "character" "character"
It doesn't do a thing! I have also tried stringsAsFactors, colClasses, and they do not change my results
Here's the whole datafile i am totally out of ideas
http://pastebin.com/YqFNpBPQ