Closed andrepist closed 3 years ago
Hi @andrepist - sorry for the (very) late reply! Regarding the two points:
msprep()
does say that argument status
should be "event indicators taking the value 1 if the state is visited or 0". I think it is safer to leave it as this, or else when converting two-level factors you would also either need to a) also specify which level corresponds to a "1" (for each status factor), b) or always assume the second level is a "1".Fixed (finally) with latest CRAN release of 0.3.2.
Hi, I came across two data type incompatibilities when using msprep.
First, my status column was made of factors and I had to convert them to integer, otherwise the mres matrix from msprepEngine was not created since the program was not able to compute Tstop * 1/stat (they were interpreted as characters). Second, my ids were characters and I had to convert them either to factor or to recode them as integer, otherwise the mres matrix was a character matrix and the computation msres$Tstop - msres$Tstart was not possible either.
May I suggest to specify the accepted data type in the documentation or to put some conversion within the code?
Thank you and really nice work with this package!