Hello,
I would like to know if there is a way to coerce createTable object to a dataframe, in order to present it via knitr in a word notebook.
If i try to use as.data.frame on a createTable class object (e.g., "table_1"), i get the following warning (reproduced from R 3.2.2):
Error in as.data.frame.default(table_1) :
cannot coerce class ""compareGroups"" to a data.frame
My final goal, as I mentioned, is to use createTable output to a word notebook, but when I use knitr::kable on a createTable object I get the same warning as mentioned above.
A quick-and-dirty hack I found to solve this problem is to export the createTable to csv by export2csv and then reading it again as dataframe, following by presenting it with knitr::kable elegantly.
Is there a better way to coerce the object to dataframe, or even better - use compareGroups smoothly with knitr?
Thanks!
S.