Hi I hope someone can shed some light on this: For some reason when I read.table("bfx.txt") R decides to only give back the first character from each column in each row as one single column. Like this: V1 1 ÿþr 2 \n 3 r 4 1 5 0 6 A 7 G 8 \n 9 r 10 1 11 0 12 T 13 C 14 \n The data should be: rs153410928 153410928 0.98802328 A G rs153411383 153411383 0.988026211 G A rs153411809 153411809 0.988028954 A G rs153411854 153411854 0.988029244 A G rs153413052 153413052 0.988036959 T C so not only is it screwing the data it's also missing the first 3 lines. Is this something I've done? I've tried dos2unix to make sure the files are ok, added colClasses="character", sep=" " etc but with no success. I'm just about at the end of my tether right now so any help will be gratefully received! Dan Daniel Alcock Malaria Genetics (T112) Wellcome Trust Sanger Institute Daniel Alcock Malaria Genetics (T112) Wellcome Trust Sanger Institute Cambridge CB10 1SA UK +44 (0)1223 834244 ext. 4994 "The most exciting phrase to hear in science, the one that heralds new discoveries, is not Eureka! But rather, "hmm.... that's funny...." -- Isaac Asimov -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a compa ny registered in England with number 2742969, whose registered office is 2 15 Euston Road, London, NW1 2BE. [[alternative HTML version deleted]]
My guess is that there's something wrong with your file. You really don't give us enough information to diagnose the problem, though. An encoding issue? If you open the file in a plain text editor, what happens? What OS are you using? Version of R? When I copy your sample data from the email into a text file, deleting the blank lines, it opens as expected using read.table() with no additiona arguments. Sarah On Tue, Nov 17, 2009 at 9:43 AM, Daniel Alcock <da2 at sanger.ac.uk> wrote:> Hi I hope someone can shed some light on this: > > > > For some reason when I > > > > read.table("bfx.txt") > > > > R decides to only give back the first character from each column in each row as one single column. > > > > Like this: > > > > ? ?V1 > > 1 ? ??r > > 2 ? ?\n > > 3 ? ? r > > 4 ? ? 1 > > 5 ? ? 0 > > 6 ? ? A > > 7 ? ? G > > 8 ? ?\n > > 9 ? ? r > > 10 ? ?1 > > 11 ? ?0 > > 12 ? ?T > > 13 ? ?C > > 14 ? \n > > > > The data should be: > > > > rs153410928 153410928 0.98802328 A G > > rs153411383 153411383 0.988026211 G A > > rs153411809 153411809 0.988028954 A G > > rs153411854 153411854 0.988029244 A G > > rs153413052 153413052 0.988036959 T C > > > > so not only is it screwing the data it's also missing the first 3 lines. Is this something I've done? I've tried dos2unix to make sure the files are ok, added colClasses="character", sep=" " etc but with no success. > > > > I'm just about at the end of my tether right now so any help will be gratefully received! > > > > Dan > >-- Sarah Goslee http://www.functionaldiversity.org