Вопрос

I am using tableNominal{reporttools} to produce frequency tables. The way I understand it, tableNominal() produces latex code which has to be copied and pasted onto a text file and then saved as .tex. But is it possible to simple export the table produced as can be done in print(xtable(table), file="path/outfile.tex"))?

Это было полезно?

Решение

You may be able to use either latex or latexTranslate from the "Hmisc" package for this purpose. If you have the necessary program infrastructure the output gets sent to your TeX engine. (You may be able to improve the level of our answers by adding specific examples.)

Looks like that function does not return a character vector, so you need to use a strategy to capture the output from cat(). Using the example in the help page:

capture.output( TN <- tableNominal(vars = vars, weights = weights, group = group, 
         cap = "Table of nominal variables.", lab = "tab: nominal") , 
         file="outfile.tex")
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top