Since you already have some more modern code which is workable, I'll take a whack at it with a base R solution...
This is(by no means) the best, most readable, or extensible solution, but I have a penchant for single-command Base R solutions which take advantage of little know quirks in the language.
Let's imagine your data.frame is named df. Then,
set.seed(8675309)
df <- data.frame(product = letters, category = sample(3, 26, TRUE))
head(df)
product category
1 a 3
2 b 2
3 c 3
4 d 1
5 e 3
6 f 1
df <- cbind(df,
t(vapply(df[["category"]],
function(y) {
y == c(weak = 1, ok = 2, strong = 3)
},
integer(3))))
head(df)
product category weak ok strong
1 a 3 0 0 1
2 b 2 0 1 0
3 c 3 0 0 1
4 d 1 1 0 0
5 e 3 0 0 1
6 f 1 1 0 0