The compile
function generates a comprehensive CSV or statistics data frame
from survey data, combining crosstabs and/or statistics for each pair of row and column variables.
Usage
compile(
data,
rowVars,
colVars,
weight,
format = c("csv", "statistics"),
save = TRUE,
name = "table"
)
Arguments
- data
A data frame containing survey data.
- rowVars
A vector of names of independent variables, each represented in rows.
- colVars
A vector of names of dependent variables, each represented in columns.
- weight
Optional variable containing weight factors for the analysis.
- format
The desired output format: 'csv' for a formatted CSV file, or 'statistics' for a statistical summary (default is 'csv').
- save
Logical; if
TRUE
, the results are saved to a CSV file (default isTRUE
).- name
The name of the output file (without extension) when
save
isTRUE
(default is 'table').