Closed ciaranmci closed 2 years ago
@wjchulme @milanwiedemann perhaps you can help Ciaran out here?
I think I fixed it with some help from @LFISHER7. I think @wjchulme is the "Will" referred to in the help. Essentially, "date_death_cpns is all NA. Unless you tell it otherwise, readr() (or similar) will import a column of NAs as a logical vector, so date_death_cpns will be logical. case_when() is strict about mixed vector types, so will give an error when you try to combine a logical with a date".
So, I explicitly declared date_death_cpns as a date and now everything works. Thanks, all
My error is with the dplyr::mutate( dplyr::case_when() ) call. The error from the job server says that "x must be a logical vector, not a
Date
object". This error doesn't arise when I run on my local machine or locally on my OpenSAFELY docker container.My R syntax is:
The error occured in a recent job run (ID: rkbgjwd6a3lczzwt)
Any ideas what might be causing the error? I'm really keen to have this output ready for the showcase on April 7th. Thanks for any help you can offer.