papaja
papaja copied to clipboard
Add a split_by option to apa_table()
apa_table() can combine lists of data.frame. It's simple to use a column to split a data.frame, to turn one column into table spanners or stub intents using split. It may be worth to add this as an option to apa_table() for convenience.
It should be as simple as adding something like the following to apa_table.data.frame():
if(!is.null(split_by) && split_by %in% colnames(x)) {
x <- lapply(split(x, f = x[[split_by]]), function(x) x[, -1])
apa_table.list(x)
}