Re: [R] Help!!! from R beginner

2011-02-05 Thread Tae-Jin Lee
Hello Jim, Thank you so much!!! It is a magic!!! Now I understand the use of ifelse. Thank you again!!! Tae-Jin On Feb 5, 2011, at 12:49 AM, jim holtman wrote: You should be able to use 'ifelse' Os.chr4.gene.new$color <- ifelse(Os.chr4.gene.new$if_TE_related == "TE_related", "black",

Re: [R] Help!!! from R beginner

2011-02-04 Thread jim holtman
You should be able to use 'ifelse' Os.chr4.gene.new$color <- ifelse(Os.chr4.gene.new$if_TE_related == "TE_related", "black", "orange") On Fri, Feb 4, 2011 at 7:09 PM, Tae-Jin Lee wrote: > Hello, > > I'm trying to add a column to the following data frame. The new column > will contain "blac

[R] Help!!! from R beginner

2011-02-04 Thread Tae-Jin Lee
Hello, I'm trying to add a column to the following data frame. The new column will contain "black" when the 5th column(if_TE_related) is "TE_related", or "orange" when the 4th column is " " (space). "chromo""MSU_locus" "end5" "end3" "if_TE_related" "chr04" "LOC_Os04g01006"