Error occurred during calling the sampler; sampling not done

The "W" = c(1,0,0,0) line is causing you problems. Change it to "W" = c(0.25, 0.25, 0.25, 0.25) or something (simplex probabilities can’t be exactly 1 or 0).