
Last chance! 50% off unlimited learning
Sale ends in
This basic function prints any data frame as a three-line table
to either R Console or Microsoft Word (.doc).
It has been used in many other functions of bruceR
(see below).
print_table(
x,
digits = 3,
nsmalls = digits,
nspaces = 1,
row.names = TRUE,
col.names = TRUE,
title = "",
note = "",
append = "",
line = TRUE,
file = NULL,
file.align.head = "auto",
file.align.text = "auto"
)
Invisibly return a list of data frame and HTML code.
Matrix, data.frame (or data.table), or any model object (e.g., lm, glm, lmer, glmer, ...
).
Numeric vector specifying the number of decimal places of output. Default is 3
.
Number of whitespaces between columns. Default is 1
.
Print row/column names. Default is TRUE
(column names are always printed).
To modify the names, you can use a character vector with the same length as the raw names.
Title text, which will be inserted in <p></p> (HTML code).
Note text, which will be inserted in <p></p> (HTML code).
Other contents, which will be appended in the end (HTML code).
Lines looks like true line (TRUE
) or === --- ===
(FALSE
).
File name of MS Word (.doc
).
Alignment of table head or table text:
"left"
, "right"
, "center"
.
Either one value of them OR a character vector of mixed values
with the same length as the table columns.
Default alignment (if set as "auto"
):
left, right, right, ..., right.
These functions have implemented MS Word file output using this function:
Describe
Freq
Corr
EFA
/ PCA
CFA
TTEST
MANOVA
model_summary
med_summary
lavaan_summary
PROCESS
granger_test
granger_causality
print_table(data.frame(x=1))
print_table(airquality, file="airquality.doc")
unlink("airquality.doc") # delete file for code check
model = lm(Temp ~ Month + Day + Wind + Solar.R, data=airquality)
print_table(model)
print_table(model, file="model.doc")
unlink("model.doc") # delete file for code check
Run the code above in your browser using DataLab