huxtable | R package to create styled tables | Development Tools library
kandi X-RAY | huxtable Summary
kandi X-RAY | huxtable Summary
If you find huxtable useful, fund me on Patreon.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of huxtable
huxtable Key Features
huxtable Examples and Code Snippets
Community Discussions
Trending Discussions on huxtable
QUESTION
I'm putting together some tables with results from a series of Cox Proportional Hazards Models. I'd like to exponentiate the coefficients so the tables display the Hazard Ratios rather than the raw beta values. Does anyone know of a way to do this with huxtable? It's my preferred package for building regression tables. I've done some googling and can't find a solution.
...ANSWER
Answered 2022-Feb-09 at 09:35You can use the tidy_args
argument to huxreg:
QUESTION
Let's say I have the following rmd:
...ANSWER
Answered 2022-Jan-31 at 22:52Your code should look like this:
QUESTION
I'm testing flextable
, a package for R by David Gohel, for the publication workflow and I was wondering about how to format substrings in the cells of the regression tables. In particular, I aim to replicate Stata's outreg2 with significance stars in bold and right next to the coefficient.
Here is the reprex:
...ANSWER
Answered 2021-Dec-07 at 09:19With flextable, you can do it quite easily by adding a signif. column after the p-values column and use 0 padding.
The following code demo how to do it from scratch:
QUESTION
I'm asking if I could export from R, a huxtable dataset in one sheet and a plot from ggplot2 in another sheet, and in the same excel file?
...ANSWER
Answered 2021-Dec-03 at 10:28Here is a potential work flow which could be adapted. Check out the package documentation for options, as the answer below only uses minimal arguments and all the packages used offer lots of options.
Updated following OP's inclusion of formatted huxtable.
QUESTION
I am looking for a way to report the number of groups alongside the number of observations using huxtable::huxreg
to create a table of results of a multilevel model predicted with lmer()
. I can write a custom glance method that overwrites the glance.merMod
method from the broom.mixed
package that works when called from R but does not work when calling huxreg()
.
I believe that the issue is that the huxreg function imports both broom
and broom.mixed
as required namespaces inside the function.
What would be the best way to overcome this issue to use the custom glance method (or an alternative other than simply adding rows to existing huxtables)?
Here's a MWE
...ANSWER
Answered 2021-Jul-20 at 14:10You can fix this using tidy_override()
:
QUESTION
How can I save a huxtable to a file in LaTeX (.tex) format? I did find this code to print LaTeX tables to the console:
...ANSWER
Answered 2021-Jul-07 at 11:04There might be other ways but using capture.output
works -
QUESTION
I would like to adjust the row padding in a jtools
regression table. I tried set_row_height
since I read that the underlying structure is a huxtable
. But I'm unsure, and it didn't work.
ANSWER
Answered 2021-May-18 at 13:02Finally, row height adjustment worked with set_tb_padding
. I cannot replicate why it didn't worked in the first place. set_row_height
requires CSS/LaTeX values, i.e. set_row_height("4cm")
. I cannot reduce row height to a resonable size but can increase row height.
QUESTION
I need to mark some special cells in the table with a gray color. Something like this:
...ANSWER
Answered 2021-Apr-30 at 16:18You can use the old-school interface and a little-known fact about R subsetting:
QUESTION
Function huxreg
in the huxtable
package automatically recognises numbers and formats them as predefined in the number_format = "%.3f"
option. I would like to report confidence intervals in my report and use the CI95: prefix. Unfortunately, the numerical part of the prefix is automatically formatted and the prefix looks like CI95.000.
Let's consider following example:
...ANSWER
Answered 2020-Dec-31 at 19:44While not optimal, you could perhaps add , number_format = c("%.3f", "%.3g", "%.3f", "%.3g")
to your huxreg
call to specifically affect the formatting of the CI95 rows of your table (or save the output as an object and then modify the attribute elements that define the formatting of those lines, e.g. do attr(res, "number_format")[[13]] <- "%.3g"
, etc.). Other than that I could only think of somehow modifying the underlying glue
transformer that transforms the entire string and leaves all numeric elements with the same formatting.
QUESTION
Rmarkdown text (between chunks) when formated italic using * * knits to pdf underlined and not italic format when I print huxtable.
Here is my example:
...ANSWER
Answered 2021-Jan-12 at 13:28From the TeXnical perspective the problem is that the ulem
package is loaded without the normalem
option. A couple of workarounds:
use
classoption: normalem
(based on Knitr hook to add code before \documentclass line in tex file to avoid options clash with xcolor). Caveat: this will pass the option to all packages and might be undesired in case the same option name is also used by other packages (I'm not aware of any other package that uses this option, but just in case ...)add
\normalem
either asheader-include
or at the start of your document
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install huxtable
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page