Hi, I wonder if you can help me: I cannot seem to be able to import my data anymore. When I try to import the attached file with the string FunctRes<-read.table("C:/Documents and Settings/FunctRes.txt", header=FALSE) I obtain: > FunctRes V1 1 ??C 2 \n 3 C 4 0 5 0 6 B 7 \n 8 C 9 0 10 1 11 B 12 \n 13 C 14 0 15 0 16 B 17 \n 18 C 19 0 20 1 21 B 22 \n 23 C 24 0 25 1 26 B 27 \n 28 C 29 0 30 1 31 B Can you help me? Thanks Nicole Dr Nicole Soranzo Centre for Population Genetics and Human Health University College London Darwin Building Gower Street London WC1E 6BT Tel: +44 (0)20 7679 4397 Fax: +44 (0)20 7679 2887 E-mail: n.soranzo at ucl.ac.uk http://popgen.biol.ucl.ac.uk/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: FunctRes.txt Url: https://stat.ethz.ch/pipermail/r-help/attachments/20040331/3ce0dd9b/FunctRes.txt
Nicole Soranzo <n.soranzo at ucl.ac.uk> writes:> I cannot seem to be able to import my data anymore. When I try to > import the attached file with the string > > FunctRes<-read.table("C:/Documents and Settings/FunctRes.txt", header=FALSE) > > I obtain: > > > FunctRes > V1 > 1 ??C...> > Can you help me?Something is wrong with your file (16-bit encoding?) I see almost every 2nd character coded as ^@ (ASCII NUL). This is the string terminator and so has antisocial consequences if it finds its way into the middle of a character string. You need to get rid of those somehow.> ??C >-- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On 31 Mar 2004 19:22:30 +0200, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote :>Nicole Soranzo <n.soranzo at ucl.ac.uk> writes: > >> I cannot seem to be able to import my data anymore. When I try to >> import the attached file with the string >> >> FunctRes<-read.table("C:/Documents and Settings/FunctRes.txt", header=FALSE) >> >> I obtain: >> >> > FunctRes >> V1 >> 1 ??C >... >> >> Can you help me? > >Something is wrong with your file (16-bit encoding?) I see almost >every 2nd character coded as ^@ (ASCII NUL).My text editor identifies it as a Unicode file. R wants plain ascii. Duncan Murdoch
Nicole Soranzo wrote:> > Hi, I wonder if you can help me: > > I cannot seem to be able to import my data anymore. When I try to import > the attached file with the string > > FunctRes<-read.table("C:/Documents and Settings/FunctRes.txt", header=FALSE) > > I obtain: > > > FunctRes > V1 > 1 ??C > 2 \n > 3 C > 4 0 > 5 0 > 6 B > 7 \n > 8 C > 9 0 > 10 1 > 11 B > 12 \n > 13 C > 14 0 > 15 0 > 16 B > 17 \n > 18 C > 19 0 > 20 1 > 21 B > 22 \n > 23 C > 24 0 > 25 1 > 26 B > 27 \n > 28 C > 29 0 > 30 1 > 31 B > > Can you help me?Strange. The file got corrupted in some way. Copy and paste the contents to another (empty) ASCII file solves the problem. [Please use a sensible subject.] Uwe Ligges> Thanks > Nicole > > Dr Nicole Soranzo > > Centre for Population Genetics and Human Health > > University College London > Darwin Building > Gower Street > London WC1E 6BT > > Tel: +44 (0)20 7679 4397 > Fax: +44 (0)20 7679 2887 > > E-mail: n.soranzo at ucl.ac.uk > http://popgen.biol.ucl.ac.uk/ > > ------------------------------------------------------------------------ > Name: FunctRes.txt > FunctRes.txt Type: Plain Text (text/plain) > Encoding: base64 > > ------------------------------------------------------------------------ > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html