Re: [R] Factor and Level Issue

2009-12-29 Thread Vishal Thapar
Please ignore my message. I figured it out myself. The way to do it is: levels(testSeq_df[,i]) <- list(a=c('a'),c=c('c'),g=('g'),t=c('t')) Thanks, vishal [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.

[R] Factor and Level Issue

2009-12-29 Thread Vishal Thapar
Dear useR's I have a small basic problem which I am hoping to get some help with. I have a data frame, testSeq_df, with 1 row and 500 columns. Each column is a character (a,c,g or t). I want this sequence to have 4 factors (a,c,g,t). When I try the following: for(i in 1:500){ if (length(level