df[c("Apple", "Banana")] <- list(df$FRUITS == "Apple", df$FRUITS == "Banana")# Gender AgeGroup EAT FRUITS Apple Banana# 1 Female 30yr_39yr Yes Apple TRUE FALSE# 2 Female 20yr_29yr Yes Apple TRUE FALSE# 3 Female 70yr_80yr Yes Apple TRUE FALSE# 4 Male 50yr_59yr Yes Banana FALSE TRUE# 5 Female 40yr_49yr Yes Apple TRUE FALSE# 6 Female 70yr_80yr Yes Apple TRUE FALSE
To generalise to more value you could use:
cols <- c("Apple", "Banana")df[cols] <- lapply(cols, \(x) df$FRUITS == x)