strengejacke / sjmisc

Data transformation and utility functions for R
https://strengejacke.github.io/sjmisc
GNU General Public License v3.0
156 stars 24 forks source link

`descr()` does not print in RMarkdown document #78

Closed januz closed 6 years ago

januz commented 6 years ago

I used to use sjt.df(data, describe = TRUE) to make tables of descriptive statistics and include them in RMarkdown documents. As this function is deprecated now, I tried to replace it with descr(), but none of the output options viewer or browser seems to include the table in the document.

strengejacke commented 6 years ago

Yes, I think I need to revise the knitr-print-method, which no longer works in the current implementation due to the recent changes in the HTML-print-methods.

januz commented 6 years ago

okay, thanks for the info! I might downgrade until then.

Possibly unrelated:

I have always asked myself whether it would be possible to get more flexibility in printing tables from your packages. My wish would be to have them output an object that can be further manipulated and print to a number of output formats with either the huxtable or pixiedust package. At the moment, I use your packages when I do first data exploration, but have to switch to other or custom solutions to prepare tables for more official outlets like journal articles (LaTeX/PDF or Word). It's probably too much to ask because you'd had to rewrite a large proportion of the code base , but I thought I'd at least ask :)

strengejacke commented 6 years ago

Ok, I have revised the knitr-print()-methods, all functions should work with knitr again now (after the next sjPlot update - will commit the changes to GitHub tonight).

I have deprecated functions likesjt.frq()for the reason of more flexibility.sjt.frq()returned the HTML code. Now you can usefrq(), which returns a tidy data frame, to use in other packages as well. The argumentout = "v"simply callssjPlot::tab_df()` (with some preparations) to print a HTML table to the viewer.

I think having the tidy data frame from the output gives you the most flexibility, or are you thinking of something else?