I encountered an error just as the title. Error in if (xhat == 0) out <- 1 else { : missing value where TRUE/FALSE neededI already read the previous issue. It showed that i need to turn mediator into numeric so that this funtion could work. But i alread turn it into numeric. It still gives this error. So i pull out 1000 rows of data out of my data and uploaded here since github seems not to be able to accept rar as attachment. Unpack it and click the rproj and open testRcode.R. Just run it you may replicate the error i encounter. Many thanks!
I encountered an error just as the title.
Error in if (xhat == 0) out <- 1 else { : missing value where TRUE/FALSE neededI already read the previous issue. It showed that i need to turn mediator into numeric so that this funtion could work. But i alread turn it into numeric. It still gives this error. So i pull out 1000 rows of data out of my data and uploaded here since github seems not to be able to accept rar as attachment. Unpack it and click the rproj and open testRcode.R. Just run it you may replicate the error i encounter. Many thanks!