You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the method <- lcMethodFlexmix includes a multivariable model hence with covariates (e.g. in the form y~ a+ b + c), ClusterTrajectories and plotClusterTrajectories return an error from the predict function Error in eval(predvars, data, env) : object 'c' not found.
This happens because of this part of the code below
setMethod('clusterTrajectories', 'lcModel', function(object, at = time(object), what = 'mu', ...) {
newdata = data.table(
Cluster = rep(clusterNames(object, factor = TRUE), each = length(at)),
Time = at
) %>%
setnames('Time', timeVariable(object))
where simulated data is created without taking into account covariates.
The text was updated successfully, but these errors were encountered:
Hi Daniela, thanks for reporting this. That is quite the oversight when I implemented the method, oops. I'll need to look into what's the best way to add support for this.
In the meantime, you can compute the cluster trajectories yourself, as it's really just a helper function that relies on the predict implementation of the outputted model.
Thanks for the answer. Yes, I had already solved temporarily the issue adding the covariates the same way you showed. Unfortunately, most of the functions after the model fitting rely on helper functions that call predict, including plots etc. so I needed to extract them from the code and running them manually. I hope you will add support for that in the future.
When the method <- lcMethodFlexmix includes a multivariable model hence with covariates (e.g. in the form y~ a+ b + c), ClusterTrajectories and plotClusterTrajectories return an error from the predict function
Error in eval(predvars, data, env) : object 'c' not found.
This happens because of this part of the code below
where simulated data is created without taking into account covariates.
The text was updated successfully, but these errors were encountered: