| to_SPSS | R Documentation |
Generic function to convert an R object into an object that contains all necessary information for printing a LaTeX table that mimics the look of SPSS output.
to_SPSS(object, ...) to_spss(object, ...)
object |
an R object for which a |
... |
additional arguments passed down to methods. |
In order to work as expected, methods of to_SPSS should return an
object of class "SPSS_table". It should include a component
table that contains a data frame, which can be supplied as the
first argument to to_latex to print a LaTeX table that mimics
the look of SPSS output. Additional components of the returned object
define additional arguments to be passed to the "data.frame" method
of to_latex.
to_spss is a simple wrapper for to_SPSS, which exists
for convenience.
Andreas Alfons
# load data
data("Eredivisie")
# compute a Kruskual-Wallis test to investigate whether
# market values differ by playing position
kw <- kruskal_test(Eredivisie, "MarketValue",
group = "Position")
# convert to an object of class "SPSS_table" that
# contains the table with the test results
kw_spss <- to_SPSS(kw, statistics = "test")
kw_spss
# blank out the number of degrees of freedom to ask
# an assignment question about it
kw_spss$table[2, 1] <- "???"
# print the LaTeX table to be included in the assignment
to_latex(kw_spss)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.