[R] not supressing leading zeros when reading a table?

2005-07-10 Thread Adrian Dusa
Dear R list, I have a dataset with a column which should be read as character, like this: name surname answer 1 xx yyy 00100 2 rrr hhh 01 When reading this dataset with read.table, I get 1 xx yyy 100 2 rrr hhh 1 The string column consists in answers to multiple choice

Re: [R] not supressing leading zeros when reading a table?

2005-07-10 Thread Marc Schwartz
On Sun, 2005-07-10 at 18:13 +, Adrian Dusa wrote: Dear R list, I have a dataset with a column which should be read as character, like this: name surname answer 1 xx yyy 00100 2 rrr hhh 01 When reading this dataset with read.table, I get 1 xx yyy 100 2 rrr hhh

Re: [R] not supressing leading zeros when reading a table?

2005-07-10 Thread Duncan Murdoch
Adrian Dusa wrote: Dear R list, I have a dataset with a column which should be read as character, like this: name surname answer 1 xx yyy 00100 2 rrr hhh 01 When reading this dataset with read.table, I get 1 xx yyy 100 2 rrr hhh 1 The string column consists

Re: [R] not supressing leading zeros when reading a table?

2005-07-10 Thread alejandro munoz
Adrian, To prevent coercion to numeric, try: mydata - read.table(myfile, colClasses=character) HTH. alejandro On 7/10/05, Adrian Dusa [EMAIL PROTECTED] wrote: Dear R list, I have a dataset with a column which should be read as character, like this: name surname answer 1 xx yyy

Re: [R] not supressing leading zeros when reading a table?

2005-07-10 Thread Adrian Dusa
On 7/10/05, alejandro munoz [EMAIL PROTECTED] wrote: Adrian, To prevent coercion to numeric, try: mydata - read.table(myfile, colClasses=character) HTH. alejandro On 7/10/05, Adrian Dusa [EMAIL PROTECTED] wrote: Dear R list, [...snip...] Thank you all, I got it. This is my