This is causing downstream problems where my code expects the confidence interval to be numeric. For example, exp(as.character(NA)) throws an error, but exp(as.numeric(NA)) does not.
Here the covariate column is set to savedParam, which in my case is a string. Later the as.matrix() causes the entire matrix to become character, including the lower and upper columns.
If we don't hit the exception, the covariate column is set to the numeric result of 'checkCovariates() instead, and the as.matrix() makes everything numeric.
The simple solution would be to change this line to say
prof <- data.frame(covariate = parm,
But it seems you went out of your way to save the parameter name. Any reason why?
This is causing downstream problems where my code expects the confidence interval to be numeric. For example,
exp(as.character(NA))throws an error, butexp(as.numeric(NA))does not.Here the
covariatecolumn is set tosavedParam, which in my case is a string. Later theas.matrix()causes the entire matrix to become character, including theloweranduppercolumns.If we don't hit the exception, the
covariatecolumn is set to the numeric result of'checkCovariates()instead, and theas.matrix()makes everything numeric.The simple solution would be to change this line to say
But it seems you went out of your way to save the parameter name. Any reason why?