Skip to content
Prev 385539 / 398503 Next

statment can tacke value in row1 and rows

Hi Hesham,
It think you are looking for something like this:

truth<-data.frame(G1=sample(LETTERS[1:4],20,TRUE),
 G2=sample(LETTERS[1:4],20,TRUE))
truth
truth$G3<-as.numeric(truth$G1 == truth$G2)
truth

Note that like quite a few emails produced with Javascript formatting,
there are embedded characters that R can't interpret.

Jim

On Thu, Sep 3, 2020 at 11:18 AM Hesham A. AL-bukhaiti via R-help
<r-help at r-project.org> wrote: