First, define a function:
conditionalResult <- function(argtype, argaction){
if (argtype=="X" & argaction=="both")
return("X")
if (argtype=="B" & argaction==1)
return("Y")
if (argtype=="B" & argaction==2)
return("Z")
After function definition convert your data to data.table:
install.packages("data.table")
require("data.table")
jiz <- as.data.table(jiz)
And create a new conditional column:
jiz[, c("Result"):=conditionalResult(Type, Action)]
Voila, now you have new column called Result in your data.table with corresponding values.