df2 = mutate(df, newcol = case_when(
A == 2 & B == “F” ~ “bingo”,
TRUE ~ “no bingo”))
And it would produce a table as such:
I’ve tried Match.jl but it doesn’t seem to broadcast easily to each row.
Both Match.jl and the map function don’t seem to be able to do a test on two columns at the same time (see in the R code how I was able to use an and statement to join a condition on column A and B: A == 2 & B == “F”)
Vectorisation is always nice, buy is it simpler to just use a for loop? I heard Julia doesn’t suffer so much of a performace hit from for loops like languages like Python & R.