I am trying to create a publication quality table, that describes the variables I have used in the analysis. Thus the table has two columns and say 20 rows. The first column is short as it contains the variable name and the second column is rather long as it gives the explanation of the variable.
I want the following:
- sideways table, aka horizontally rotated
- fits to one page (letter or a4)
- automatically breaks lines in column 2 to adjust for long descriptions (to not have text flowing "over the page")
I have tried both pander::pandoc.table and xtable. They only get me to 80% of the way. with pander I can get adjustable cell heights but not a rotated table and with stable I get a rotated table, but the table does not fit one page.
Here is the code so far:
print(xtable::xtable(variablesused, auto = TRUE, caption = "Variable Definitions"), floating = TRUE, floating.environment = "sidewaystable", sanitize.text.function = force, include.rownames = FALSE)
I don't want to use scale box, as this would just make the overall table smaller. With line breaks in the second column and correspondingly "bigger" rows the table would look perfect.
Thank you so much!