For some features, DirichletMultinomial cannot fit a model and returns NULL. CalcPolyAResiduals avoids adding those features to the ec and var dataframe., but it assumes that the first feature is fit. If the first feature is not fit, ec and var are not properly initialized and cbind on R/fit.R:119 will throw an error.
Pull request initializes the dataframes with a dummy column with the appropriate number of rows, which is dropped after the construction of the full dataframe.
For some features, DirichletMultinomial cannot fit a model and returns NULL. CalcPolyAResiduals avoids adding those features to the
ec
andvar
dataframe., but it assumes that the first feature is fit. If the first feature is not fit,ec
andvar
are not properly initialized andcbind
on R/fit.R:119 will throw an error. Pull request initializes the dataframes with a dummy column with the appropriate number of rows, which is dropped after the construction of the full dataframe.