Closed ruddjm closed 6 years ago
The only place where digits is referenced in latex.summaryM has this:
if(!missing(digits)) {
oldopt <- options(digits=digits)
on.exit(options(oldopt))
}
So I need help figuring out how that could not do the job.
I think you want this instead:
oldopt <- options('digits')
options(digits = digits)
on.exit(options(oldopt))
Sorry for not responding sooner. That fix was made a while ago but can't remember if it's on CRAN. It will definitely be in the new version to be submitted to CRAN within 2 days.
When including 2 variables on the right hand side of the formula argument, providing a digits argument can change the global digits option.
Here is an example:
set.seed(173) country <- factor(sample(c('US', 'Canada'), 500, rep=TRUE)) age <- rnorm(500, 50, 5) treatment <- factor(sample(c("Drug","Placebo"), 500, rep=TRUE))
options(digits = 3) latex( summaryM(age ~ treatment + country), digits = 1, file = "") options('digits')
This is happening with or without providing a group argument.