Re: [R] Converting Factor to Vector

2009-01-13 Thread Patrick Burns
Using 'str' to see what you have is excellent practice (and very helpful to show in messages to R-help). However, you need to look at the output you get more carefully. You have a data frame that contains a factor. So: as.character(repo[, 1]) should do what you want. Patrick Burns patr...@bu

Re: [R] Converting Factor to Vector

2009-01-12 Thread David Winsemius
But repo is a dataframe. AAA is a factor within repo. You probably need to apply as.character to repo$AAA. -- David Winsemius On Jan 13, 2009, at 12:50 AM, Gundala Viswanath wrote: Hi Bill, However with as.character it fail show the actual strings. It gives this: new_repo <- as.characte

Re: [R] Converting Factor to Vector

2009-01-12 Thread Gundala Viswanath
Hi Bill, However with as.character it fail show the actual strings. It gives this: > new_repo <- as.character(repo) > str(new_repo) chr "1:32267" > print(new_repo) [1] "1:32267" Instead of >> str(new_repo) > chr [1:100] "AAA" "AAT" "AAC" "AAG" "ATA" "ATT"... > >> print(new_repo) > [1] "AAA" "

Re: [R] Converting Factor to Vector

2009-01-12 Thread Bill.Venables
as.character() Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gundala Viswanath Sent: Tuesday, 13 January 2009 3:25 PM To: r-h...@stat.math.ethz.ch Subject: [R] Converting