xltabr seems to be the only way to create excel contingency tables in R.
I am trying to use this write out a contingency tab to excel, but the auto_crosstab_to_wb command has been running for over an hour with no result. (I see the red icon on the console indicating that it is still running). I realize now that it is something to do with my studio/packages, so it's hard to reproduce the problem.
See here for the code required to reproduce the problem with xltabr:
devtools::install_github("moj-analytical-services/xltabr")
library(reshape2)
library(Rcpp)
iris
ct <- reshape2::dcast(iris, Sepal.Length ~ Species, fun.aggregate = length, value.var = "Sepal.Length")
wb <- xltabr::auto_crosstab_to_wb(ct) # this is the line taking hours to run
- Any idea why this could be happening (to just me)? I updated all my packages but still no difference. What else can I do to debug this? I don't see any warnings so it's really baffling.
- Is there any other function that allows one to write multiple contingency tables to either excel or csv? This is helpful: crosstable() export to csv but I have to run append hundreds of tables & I know this is a real pain to do in R.