Re: [R] not complete character in csv file

2011-12-12 Thread Rolf Turner
On 13/12/11 04:39, threshold wrote: Indeed in txt it looks fine. Anyway, I must stay without 0 because csv is THE format. It may well be the case that csv is THE format, but csv is not the problem. Excel is the problem. The solution is: Don't use Excel!!! (This is excellent advice in any c

Re: [R] not complete character in csv file

2011-12-12 Thread threshold
right, Table <- data.frame(matrix(0,8,3)) day = "Monday" Table[1,1]=day Table[1,2]=3 works, thanks a lot. robert -- View this message in context: http://r.789695.n4.nabble.com/not-complete-character-in-csv-file-tp4185785p4186639.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] not complete character in csv file

2011-12-12 Thread R. Michael Weylandt
Matrix (which is secretly a vector) can only have one mode (numeric/factor/character/etc.) for all its elements. If you need multiple types, go to a data frame Michael On Mon, Dec 12, 2011 at 10:39 AM, threshold wrote: > Indeed in txt it looks fine. Anyway, I must stay without 0 because csv is

Re: [R] not complete character in csv file

2011-12-12 Thread threshold
Indeed in txt it looks fine. Anyway, I must stay without 0 because csv is THE format. I got another question. why for Table <- matrix(0,8,3) day = "Monday" Table[1,1]=day all other elements become characters too? Thanks, robert -- View this message in context: http://r.789695.n4.nabble.com/n

Re: [R] not complete character in csv file

2011-12-12 Thread David Winsemius
On Dec 12, 2011, at 7:23 AM, threshold wrote: Dear R users, I got the following problem. Given that data[3,2] [1] "010252" Code: intro <- data.frame() intro[1,1] <- as.character(data[3,2]) write.csv(intro, file='intro.csv') In 'intro.csv' file I am loosing the 0 in frot of 10252, which I

Re: [R] not complete character in csv file

2011-12-12 Thread Jean V Adams
threshold wrote on 12/12/2011 06:23:33 AM: > Dear R users, I got the following problem. Given that > > > data[3,2] > [1] "010252" > > Code: > intro <- data.frame() > intro[1,1] <- as.character(data[3,2]) > write.csv(intro, file='intro.csv') > > In 'intro.csv' file I am loosing the 0 in frot of