[R] Newbie problem with read.table

Jan Conrad Jan.Conrad at cern.ch
Wed Oct 12 14:31:53 CEST 2005


Hi R,
 I have a seemingly simple problem. I have a table in following format
(tab seperated)

   Njets NBjets	NElec	  NMuon   Meff	HT	  HT3j	HE	  Aplan
Plan	       
1  4     3	 	2       0       366.278 253.642 87.7473   1385
0.0124566   0.376712       
2  3     1      	1       0       235.19  157.688 18.2852
574.253 0.00064187  0.00528814 

I read in with:

> ttbar<-read.table("test2.dat",header=TRUE)


> ttbar
  Njets NBjets NElec NMuon    Meff      HT    HT3j       HE      Aplan
1     4      3     2     0 366.278 253.642 87.7473 1385.000 0.01245660
2     3      1     1     0 235.190 157.688 18.2852  574.253 0.00064187
        Plan
1 0.37671200
2 0.00528814,

 i.e.. the table is split after 9 variables. How come ?

Thanks,
Jan




More information about the R-help mailing list